beamtea_term (beamtea v0.1.0)
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.
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.
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.
Reset all attributes.
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 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 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.
-spec reset() -> binary().
Reset all attributes.
-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().