Crate termal_codes

Source

Macros§

bg
creates a true rgb foreground color. R, G and B must be values in range 0..256
bg256
creates a background color, color is value in range 0..256
column
Moves cursor to the given column
csi
Creates escape sequence, the first literal is the end of the sequence, the other arguments are the values in the sequence
fg
creates a true rgb foreground color. R, G and B must be values in range 0..256
fg256
creates a foreground color, color is value in range 0..256
move_down
Moves cursor down by N positions
move_left
Moves cursor left by N positions
move_right
Moves cursor right by N positions
move_to
Moves cursor to the given position.
move_up
Moves cursor up by N positions
seq
Creates the given sequence, this is used internally, you should use the macro csi!
set_down
Moves cursor to the start of line N lines down
set_up
Moves cursor to the start of line N lines up

Constants§

BACKSPACE
Moves the cursor left by one positoin
BELL
Produces terminal bell
BLACK_BG
Set the background color to black (dark black)
BLACK_FG
Set the foreground color to black (dark black)
BLINKING
Set blinking mode
BLUE_BG
Set the background color to blue (bright blue)
BLUE_DARK_BG
Set the background color to dark blue
BLUE_DARK_FG
Set the foreground color to dark blue
BLUE_FG
Set the foreground color to blue (bright blue)
BOLD
Set bold text mode (on some terminals may be just brighter color)
CARRIAGE_RETURN
Moves cursor to the start of the line
CSI
Control Sequence Introducer: Start of CSI sequence
CUR_LOAD
Restores the cursor position to the last saved position (this is single save slot, not stack)
CUR_SAVE
Saves the cursor position (this is single save slot, not stack)
CYAN_BG
Set the background color to cyan (bright cyan)
CYAN_DARK_BG
Set the background color to dark cyan
CYAN_DARK_FG
Set the foreground color to dark cyan
CYAN_FG
Set the foreground color to cyan (bright cyan)
DCS
Device Control String: Start of DCS sequence
DELETE
Does nothing
DISABLE_ALTERNATIVE_BUFFER
Disables the laternative buffer
DISABLE_LINE_WRAP
Disables line wrapping
DOUBLE_UNDERLINE
Set double underline mode
ENABLE_ALTERNATIVE_BUFFER
Enables alternative buffer
ENABLE_LINE_WRAP
Enables line wrapping
ERASE_ALL
Erases the whole screen and the scrollback buffer
ERASE_FROM_LN_START
Erases from the start of the line to the cursor
ERASE_FROM_START
Erases from the start of the screen to the cursor
ERASE_LINE
Erases the entire line
ERASE_SCREEN
Erases the entire screen
ERASE_TO_END
Erases from the cursor to the end of the screen
ERASE_TO_LN_END
Erases from cursor to the end of the line
ESC
! Module with ansi escape codes. Most of them are taken from: ! https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 The escape character
FAINT
Set dim/faint text mode
FORMFEED
Indicates new page, usualy has no use in terminal
GRAY_BG
Set the background color to gray (bright black)
GRAY_BRIGHT_BG
Set to background color to bright gray (dark white)
GRAY_BRIGHT_FG
Set to foreground color to bright gray (dark white)
GRAY_FG
Set the foreground color to gray (bright black)
GREEN_BG
Set the background color to green (bright green)
GREEN_DARK_BG
Set the background color to dark green
GREEN_DARK_FG
Set the foreground color to dark green
GREEN_FG
Set the foreground color to green (bright green)
HIDE_CURSOR
Makes the cursor invisible
HTAB
Horizontal tabulator, moves cursor to the next stop
INVERSE
Set inverse mode (inverse foreground and background)
INVISIBLE
Set invisible mode (foreground is same as background)
ITALIC
Set italic mode
LOAD_SCREEN
Loads the last saved screen
MAGENTA_BG
Set the background color to magenta (bright magenta)
MAGENTA_DARK_BG
Set the background color to dark magenta
MAGENTA_DARK_FG
Set the foreground color to dark magenta
MAGENTA_FG
Set the foreground color to magenta (bright magenta)
NEWLINE
Moves the cursor to the start of the next line
OCS
Operating System Command: Start of OCS sequence
RED_BG
Set the background color to red (bright red)
RED_DARK_BG
Set the background color to dark red
RED_DARK_FG
Set the foreground color to dark red
RED_FG
Set the foreground color to red (bright red)
RESET
Resets all the text modes (colors and styles)
RESET_BG
Reset the background color
RESET_BLINKING
Reset BLINKING mode
RESET_BOLD
Reset BOLD and FAINT mode
RESET_FG
Reset the foreground color
RESET_INVERSE
Reset INVERSE mode
RESET_INVISIBLE
Reset INVISIBLE mode
RESET_ITALIC
Reset ITALIC mode
RESET_STRIKETROUGH
Reset STRIKETROUGH mode
RESET_UNDERLINE
Reset UNDERLINE and DOUBLE_UNDERLINE mode
SAVE_SCREEN
Saves the visible part of the screen buffer
SHOW_CURSOR
Makes the cursor visible
STRIKETROUGH
Set striketrough mode
UNDERLINE
Set underline mode
UP_SCRL
Moves cursor one line up, scrolling if needed
VTAB
Vertical tabulator, moves the cursor to the next vertical stop
WHITE_BG
Set the background color to white (bright white)
WHITE_FG
Set the foreground color to white (bright white)
YELLOW_BG
Set the background color to yellow (bright yellow)
YELLOW_DARK_BG
Set the background color to dark yellow
YELLOW_DARK_FG
Set the foreground color to dark yellow
YELLOW_FG
Set the foreground color to yellow (bright yellow)

Traits§

GetString
Trait for getting string from &str and String