beamtea_term (beamtea v0.1.2)
View SourceLow-level ANSI/VT terminal escape sequences.
Every function returns an iodata() escape string that can be embedded directly in a view or written to the terminal. Kept deliberately small and dependency-free so it is trivial to unit-test on any platform.
Summary
Functions
Switch to the alternate screen buffer (like vim/less).
Restore the primary screen buffer.
256-colour background.
24-bit truecolor background.
Clear the whole screen.
Clear from the cursor to the end of the screen.
Clear from the cursor to the end of the current line.
256-colour foreground.
24-bit truecolor foreground.
Move the cursor to the top-left corner.
Move the cursor to a 1-indexed {Row, Col}.
Wrap Text in the given SGR codes and reset afterwards.
Paint Text in a truecolor {R, G, B} foreground and reset.
Reset all attributes.
Equivalent to rule(Width, <<"─"/utf8>>).
A horizontal rule: Glyph repeated to Width columns.
Build an SGR sequence from a list of numeric codes, e.g. sgr([1, 38, 5, 205]).
Functions
-spec alt_enter() -> binary().
Switch to the alternate screen buffer (like vim/less).
-spec alt_leave() -> binary().
Restore the primary screen buffer.
-spec bg(0..255) -> iodata().
256-colour background.
-spec bg_rgb(0..255, 0..255, 0..255) -> iodata().
24-bit truecolor background.
-spec clear() -> binary().
Clear the whole screen.
-spec clear_below() -> binary().
Clear from the cursor to the end of the screen.
-spec clear_line() -> binary().
Clear from the cursor to the end of the current line.
-spec fg(0..255) -> iodata().
256-colour foreground.
-spec fg_rgb(0..255, 0..255, 0..255) -> iodata().
24-bit truecolor foreground.
-spec hide_cursor() -> binary().
-spec home() -> binary().
Move the cursor to the top-left corner.
-spec move(pos_integer(), pos_integer()) -> iodata().
Move the cursor to a 1-indexed {Row, Col}.
-spec paint([non_neg_integer()], iodata()) -> iodata().
Wrap Text in the given SGR codes and reset afterwards.
Paint Text in a truecolor {R, G, B} foreground and reset.
-spec reset() -> binary().
Reset all attributes.
-spec rule(non_neg_integer()) -> iodata().
Equivalent to rule(Width, <<"─"/utf8>>).
-spec rule(non_neg_integer(), binary()) -> iodata().
A horizontal rule: Glyph repeated to Width columns.
-spec sgr([non_neg_integer()]) -> iodata().
Build an SGR sequence from a list of numeric codes, e.g. sgr([1, 38, 5, 205]).
-spec show_cursor() -> binary().