TerminalOutput

Terminal output class.

Derived from FormatOutput in ocean.io.stream.Format, and reimplements methods to return typeof(this), for easy method chaining. Note that not all methods are reimplemented in this way, only those which we commonly use. Others may be added if needed.

Constructors

this
this(OutputStream output, istring eol)

Construct a FormatOutput instance, tying the provided stream to a layout formatter.

Members

Aliases

black
alias black = csiSeq!(Terminal.Foreground.BLACK)
Undocumented in source.
black_bg
alias black_bg = csiSeq!(Terminal.Background.BLACK)
Undocumented in source.
blue
alias blue = csiSeq!(Terminal.Foreground.BLUE)
Undocumented in source.
blue_bg
alias blue_bg = csiSeq!(Terminal.Background.BLUE)
Undocumented in source.
cr
alias cr = csiSeq!("0" ~ Terminal.HORIZONTAL_MOVE_CURSOR)

Carriage return (sends cursor back to the start of the line).

cyan
alias cyan = csiSeq!(Terminal.Foreground.CYAN)
Undocumented in source.
cyan_bg
alias cyan_bg = csiSeq!(Terminal.Background.CYAN)
Undocumented in source.
default_bg
alias default_bg = csiSeq!(Terminal.Background.DEFAULT)

Background colour changing methods.

default_colour
alias default_colour = csiSeq!(Terminal.Foreground.DEFAULT)

Foreground colour changing methods.

green
alias green = csiSeq!(Terminal.Foreground.GREEN)
Undocumented in source.
green_bg
alias green_bg = csiSeq!(Terminal.Background.GREEN)
Undocumented in source.
magenta
alias magenta = csiSeq!(Terminal.Foreground.MAGENTA)
Undocumented in source.
magenta_bg
alias magenta_bg = csiSeq!(Terminal.Background.MAGENTA)
Undocumented in source.
red
alias red = csiSeq!(Terminal.Foreground.RED)
Undocumented in source.
red_bg
alias red_bg = csiSeq!(Terminal.Background.RED)
Undocumented in source.
up
alias up = csiSeq!("1" ~ Terminal.CURSOR_UP)

Move the cursor up a line

white
alias white = csiSeq!(Terminal.Foreground.WHITE)
Undocumented in source.
white_bg
alias white_bg = csiSeq!(Terminal.Background.WHITE)
Undocumented in source.
yellow
alias yellow = csiSeq!(Terminal.Foreground.YELLOW)
Undocumented in source.
yellow_bg
alias yellow_bg = csiSeq!(Terminal.Background.YELLOW)
Undocumented in source.

Classes

BackgroundColour
class BackgroundColour

Background colour class. Resets the default background colour, if it has been changed, when scope exits.

TextColour
class TextColour

Foreground text colour scope class. Resets the default text colour, if it has been changed, when scope exits.

Functions

bold
typeof(this) bold(bool on)

Sets / unsets bold text output.

clearline
typeof(this) clearline()

Output terminal control characters to clear the rest of the line. Note: does not flush. (Flush explicitly if you need to.)

csiSeq
typeof(this) csiSeq()

Template method to output a CSI sequence

endrow
typeof(this) endrow()

Move the current cursor position to the last row of the terminal. This method adapts to changes in the size of the terminal.

flush
typeof(this) flush()

Emit/purge buffered content.

flush
typeof(this) flush(bool yes)

Control implicit flushing of newline(), where true enables flushing. An explicit flush() will always flush the output.

format
typeof(this) format(cstring fmt, Args args)

See FormatOutput.format

formatln
typeof(this) formatln(cstring fmt, Args args)

See FormatOutput.formatln

newline
typeof(this) newline()

Output a newline and optionally flush.

Variables

redirect
bool redirect;

True if it's redirected.

Inherited Members

From FormatOutput

flush
alias flush = OutputFilter.flush
Undocumented in source.
nl
alias nl = newline
Undocumented in source.
Eol
auto Eol;
Undocumented in source.
format
typeof(this) format(cstring fmt, Args args)

Format the provided arguments to the stream according to the format string

formatln
typeof(this) formatln(cstring fmt, Args args)

Format the provided arguments to the stream according to the format string, and append a newline to the output.

newline
FormatOutput newline()

Output a newline and optionally flush.

flush
FormatOutput flush(bool yes)

Control implicit flushing of newline(), where true enables flushing. An explicit flush() will always flush the output.

stream
OutputStream stream()

Return the associated output stream.

stream
FormatOutput stream(OutputStream output)

Set the associated output stream.

emit
void emit(cstring s)

Sink for passing to the formatter.

Meta