Pure ANSI escape code generators.
Returns strings containing ANSI escape sequences for cursor control, screen manipulation, true-colour foreground/background, mouse event handling, and alternate screen buffers.
Summary
Functions
Switches back to normal screen buffer.
Switches to alternate screen buffer.
Sets 24-bit true-color background.
Turns bold text on.
Clears the entire screen (alias for clear_screen/0).
Clears the current line.
Clears the entire screen.
Moves cursor to home position (1,1).
Turns faint/dim text on (alias for faint_on/0).
Turns faint/dim text on.
Sets 24-bit true-color foreground.
Hides the terminal cursor.
Turns italic text on (alias for italic_on/0).
Turns italic text on.
Disables mouse tracking.
Enables mouse tracking (SGR extended mode).
Disables SGR mouse mode.
Enables SGR mouse mode.
Moves cursor to position (alias for move_to/2).
Moves cursor to position (1-indexed).
Alias for reset_attributes/0.
Resets all text attributes.
Restores cursor position.
Saves cursor position.
Shows the terminal cursor.
Turns underline on.
Functions
@spec alt_screen_off() :: String.t()
Switches back to normal screen buffer.
@spec alt_screen_on() :: String.t()
Switches to alternate screen buffer.
@spec bg(0..255, 0..255, 0..255) :: String.t()
Sets 24-bit true-color background.
Returns ANSI escape: \e[48;2;R;G;Bm
@spec bold() :: String.t()
Turns bold text on (alias for bold_on/0).
@spec bold_on() :: String.t()
Turns bold text on.
@spec clear() :: String.t()
Clears the entire screen (alias for clear_screen/0).
@spec clear_line() :: String.t()
Clears the current line.
@spec clear_screen() :: String.t()
Clears the entire screen.
@spec cursor_home() :: String.t()
Moves cursor to home position (1,1).
@spec dim() :: String.t()
Turns faint/dim text on (alias for faint_on/0).
@spec faint_on() :: String.t()
Turns faint/dim text on.
@spec fg(0..255, 0..255, 0..255) :: String.t()
Sets 24-bit true-color foreground.
Returns ANSI escape: \e[38;2;R;G;Bm
@spec hide_cursor() :: String.t()
Hides the terminal cursor.
@spec italic() :: String.t()
Turns italic text on (alias for italic_on/0).
@spec italic_on() :: String.t()
Turns italic text on.
@spec mouse_off() :: String.t()
Disables mouse tracking.
@spec mouse_on() :: String.t()
Enables mouse tracking (SGR extended mode).
@spec mouse_sgr_off() :: String.t()
Disables SGR mouse mode.
@spec mouse_sgr_on() :: String.t()
Enables SGR mouse mode.
@spec move(non_neg_integer(), non_neg_integer()) :: String.t()
Moves cursor to position (alias for move_to/2).
@spec move_to(pos_integer(), pos_integer()) :: String.t()
Moves cursor to position (1-indexed).
col is the column (x), row is the row (y).
@spec reset() :: String.t()
Alias for reset_attributes/0.
@spec reset_attributes() :: String.t()
Resets all text attributes.
@spec restore_cursor() :: String.t()
Restores cursor position.
@spec save_cursor() :: String.t()
Saves cursor position.
@spec show_cursor() :: String.t()
Shows the terminal cursor.
@spec underline_on() :: String.t()
Turns underline on.