Skip to main content

Module ansi_codes

Module ansi_codes 

Source
Expand description

ANSI escape sequence constants and utilities

Modules§

semantic

Enums§

HitlNotifyMode
Notification preference (rich OSC vs bell-only)
TerminalNotifyKind
Terminal-specific notification capabilities

Constants§

ALT_BUFFER_DISABLE
ALT_BUFFER_ENABLE
BEL
Bell character (BEL = 0x07)
BG_BLACK
BG_BLUE
BG_BRIGHT_BLACK
BG_BRIGHT_BLUE
BG_BRIGHT_CYAN
BG_BRIGHT_GREEN
BG_BRIGHT_MAGENTA
BG_BRIGHT_RED
BG_BRIGHT_WHITE
BG_BRIGHT_YELLOW
BG_CYAN
BG_DEFAULT
BG_GREEN
BG_MAGENTA
BG_RED
BG_WHITE
BG_YELLOW
BLINK
BOLD
CLEAR_LINE
CLEAR_SAVED_LINES
CLEAR_SCREEN
CLEAR_TO_END_OF_LINE
CLEAR_TO_END_OF_SCREEN
CLEAR_TO_START_OF_LINE
CLEAR_TO_START_OF_SCREEN
CSI
Control Sequence Introducer (CSI = ESC[)
CURSOR_HIDE
CURSOR_HOME
CURSOR_RESTORE_DEC
CURSOR_RESTORE_SCO
CURSOR_SAVE_DEC
CURSOR_SAVE_SCO
CURSOR_SHOW
DCS
Device Control String (DCS = ESC P)
DIM
ESC
Escape character (ESC = 0x1B = 27)
FG_BLACK
FG_BLUE
FG_BRIGHT_BLACK
FG_BRIGHT_BLUE
FG_BRIGHT_CYAN
FG_BRIGHT_GREEN
FG_BRIGHT_MAGENTA
FG_BRIGHT_RED
FG_BRIGHT_WHITE
FG_BRIGHT_YELLOW
FG_CYAN
FG_DEFAULT
FG_GREEN
FG_MAGENTA
FG_RED
FG_WHITE
FG_YELLOW
HIDDEN
ITALIC
LINE_WRAP_DISABLE
LINE_WRAP_ENABLE
OSC
Operating System Command (OSC = ESC])
RESET
RESET_BLINK
RESET_BOLD_DIM
RESET_HIDDEN
RESET_ITALIC
RESET_REVERSE
RESET_STRIKETHROUGH
RESET_UNDERLINE
REVERSE
SCREEN_RESTORE
SCREEN_SAVE
ST
String Terminator (ST = ESC )
STRIKETHROUGH
UNDERLINE

Functions§

bg_256
bg_rgb
bold
colored
combine_styles
contains_ansi
cursor_down
cursor_left
cursor_right
cursor_to
cursor_up
dim
display_width
ends_with_ansi
fg_256
fg_rgb
format_styled_into
is_bell_enabled
Determine whether the bell should play, honoring an env override.
italic
notify_attention
pad_to_width
play_bell
Play the terminal bell when enabled.
starts_with_ansi
truncate_to_width
underline
write_styled