Terminal

Struct containing information and helpers to handle terminals

Most of the control sequences can be prefixed with a ASCII digit string (referred to by 'n' from now on) representing usually how often the command should be executed.

Cases where this is not the case are documented.

Members

Enums

Colour
enum Colour

Colour arrays, one for foreground and one for background colours Each uses the Colour enum values as index

Static variables

bg_colour_codes
immutable(istring[]) bg_colour_codes;
Undocumented in source.
columns
ushort columns;

Amount of columns available in the terminal

fg_colour_codes
immutable(istring[]) fg_colour_codes;
Undocumented in source.
rows
ushort rows;

Amount of rows (lines) available in the terminal

Structs

Background
struct Background
Undocumented in source.
Foreground
struct Foreground

Colours

Variables

BOLD
enum istring BOLD;

Bold / non-bold text.

CSI
enum istring CSI;

Start Sequence

CURSOR_UP
enum istring CURSOR_UP;

Command for cursor up

ERASE_REST_OF_LINE
enum istring ERASE_REST_OF_LINE;

Command for erasing the rest of the line

ERASE_REST_OF_SCREEN
enum istring ERASE_REST_OF_SCREEN;

Command for erasing everything below and right of the cursor

HIDE_CURSOR
enum istring HIDE_CURSOR;

Command for hiding the cursor

HORIZONTAL_MOVE_CURSOR
enum istring HORIZONTAL_MOVE_CURSOR;

Moves the cursor to column n.

INSERT_LINE
enum istring INSERT_LINE;

Command for inserting a line

LINE_UP
enum istring LINE_UP;

Moves the cursor n lines up and places it at the beginning of the line

NON_BOLD
enum istring NON_BOLD;
Undocumented in source.
SCROLL_UP
enum istring SCROLL_UP;

Command for scrolling up

SHOW_CURSOR
enum istring SHOW_CURSOR;

Command for showing the cursor

Examples

// Move the cursor four lines up
Stdout.formatln("{}4{}", Terminal.CSI, Terminal.CURSOR_UP);

Meta