TerminalEscapeCodes¶
These strings can be embedded in text when writing to a StdStream to create a text-based UI.
trait ref TerminalEscapeCodes
Public Functions¶
up¶
Move the cursor up n lines. 0 is the same as 1.
fun box up(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
down¶
Move the cursor down n lines. 0 is the same as 1.
fun box down(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
right¶
Move the cursor right n columns. 0 is the same as 1.
fun box right(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
left¶
Move the cursor left n columns. 0 is the same as 1.
fun box left(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
cursor¶
Move the cursor to line y, column x. 0 is the same as 1. This indexes from the top left corner of the screen.
fun box cursor(
x: U32 val = 0,
y: U32 val = 0)
: String val
Parameters¶
Returns¶
- String val
clear¶
Clear the screen and move the cursor to the top left corner.
fun box clear(
how_much: (EraseBefore val | EraseAfter val | EraseAll val) = reference)
: String val
Parameters¶
- how_much: (EraseBefore val | EraseAfter val | EraseAll val) = reference
Returns¶
- String val
erase¶
Erases some or all of the line the cursor is on.
fun box erase(
how_much: (EraseBefore val | EraseAfter val | EraseAll val) = reference)
: String val
Parameters¶
- how_much: (EraseBefore val | EraseAfter val | EraseAll val) = reference
Returns¶
- String val
reset¶
Resets all colours and text styles to the default.
fun box reset()
: String val
Returns¶
- String val
bold¶
Bold text. Does nothing on Windows.
fun box bold(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
underline¶
Underlined text. Does nothing on Windows.
fun box underline(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
blink¶
Blinking text. Does nothing on Windows.
fun box blink(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
reverse¶
Swap foreground and background colour.
fun box reverse(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
black¶
Black text.
fun box black()
: String val
Returns¶
- String val
red¶
Red text.
fun box red()
: String val
Returns¶
- String val
green¶
Green text.
fun box green()
: String val
Returns¶
- String val
yellow¶
Yellow text.
fun box yellow()
: String val
Returns¶
- String val
blue¶
Blue text.
fun box blue()
: String val
Returns¶
- String val
magenta¶
Magenta text.
fun box magenta()
: String val
Returns¶
- String val
cyan¶
Cyan text.
fun box cyan()
: String val
Returns¶
- String val
grey¶
Grey text.
fun box grey()
: String val
Returns¶
- String val
white¶
White text.
fun box white()
: String val
Returns¶
- String val
bright_red¶
Bright red text.
fun box bright_red()
: String val
Returns¶
- String val
bright_green¶
Bright green text.
fun box bright_green()
: String val
Returns¶
- String val
bright_yellow¶
Bright yellow text.
fun box bright_yellow()
: String val
Returns¶
- String val
bright_blue¶
Bright blue text.
fun box bright_blue()
: String val
Returns¶
- String val
bright_magenta¶
Bright magenta text.
fun box bright_magenta()
: String val
Returns¶
- String val
bright_cyan¶
Bright cyan text.
fun box bright_cyan()
: String val
Returns¶
- String val
bright_grey¶
Bright grey text.
fun box bright_grey()
: String val
Returns¶
- String val
black_bg¶
Black background.
fun box black_bg()
: String val
Returns¶
- String val
red_bg¶
Red background.
fun box red_bg()
: String val
Returns¶
- String val
green_bg¶
Green background.
fun box green_bg()
: String val
Returns¶
- String val
yellow_bg¶
Yellow background.
fun box yellow_bg()
: String val
Returns¶
- String val
blue_bg¶
Blue background.
fun box blue_bg()
: String val
Returns¶
- String val
magenta_bg¶
Magenta background.
fun box magenta_bg()
: String val
Returns¶
- String val
cyan_bg¶
Cyan background.
fun box cyan_bg()
: String val
Returns¶
- String val
grey_bg¶
Grey background.
fun box grey_bg()
: String val
Returns¶
- String val
white_bg¶
White background.
fun box white_bg()
: String val
Returns¶
- String val
bright_red_bg¶
Bright red background.
fun box bright_red_bg()
: String val
Returns¶
- String val
bright_green_bg¶
Bright green background.
fun box bright_green_bg()
: String val
Returns¶
- String val
bright_yellow_bg¶
Bright yellow background.
fun box bright_yellow_bg()
: String val
Returns¶
- String val
bright_blue_bg¶
Bright blue background.
fun box bright_blue_bg()
: String val
Returns¶
- String val
bright_magenta_bg¶
Bright magenta background.
fun box bright_magenta_bg()
: String val
Returns¶
- String val
bright_cyan_bg¶
Bright cyan background.
fun box bright_cyan_bg()
: String val
Returns¶
- String val
bright_grey_bg¶
Bright grey background.
fun box bright_grey_bg()
: String val
Returns¶
- String val
cursor_save¶
Save current cursor position
fun box cursor_save()
: String val
Returns¶
- String val
cursor_restore¶
Restore last saved cursor position
fun box cursor_restore()
: String val
Returns¶
- String val
cursor_hide¶
Hide the terminal cursor
fun box cursor_hide()
: String val
Returns¶
- String val
cursor_show¶
Show the terminal cursor
fun box cursor_show()
: String val
Returns¶
- String val
switch_to_alt_screen¶
Switch to the alternate screen buffer
fun box switch_to_alt_screen()
: String val
Returns¶
- String val
switch_to_normal_screen¶
Switch back to the normal screen buffer
fun box switch_to_normal_screen()
: String val
Returns¶
- String val
mouse_enable¶
Enable mouse input events
fun box mouse_enable()
: String val
Returns¶
- String val
mouse_disable¶
Disable mouse input handling
fun box mouse_disable()
: String val
Returns¶
- String val
reset_color¶
Resets foreground colour (but not the text styles)
fun box reset_color()
: String val
Returns¶
- String val
reset_color_bg¶
Resets foreground colour (but not the text styles)
fun box reset_color_bg()
: String val
Returns¶
- String val
color¶
Select an 8-bit foreground (text) color.
fun box color(
fg: U8 val)
: String val
Parameters¶
- fg: U8 val
Returns¶
- String val
color_bg¶
Select an 8-bit background color.
fun box color_bg(
bg: U8 val)
: String val
Parameters¶
- bg: U8 val
Returns¶
- String val
faint¶
Lighten (faint) text. May not work on Windows.
fun box faint(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
italics¶
Italicize text. May not work on Windows.
fun box italics(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
invert¶
Invert foreground/background colour. May not work on Windows.
fun box invert(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
conceal¶
Conceal (hide) the text. May not work on Windows.
fun box conceal(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
strikeout¶
Strike through text. May not work on Windows.
fun box strikeout(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
repeat_char¶
fun box repeat_char(
char: String val,
times: U32 val)
: String val
Parameters¶
Returns¶
- String val