gleamtea/term

Low-level ANSI/VT terminal escape sequences.

Thin bindings to beamtea’s beamtea_term. Every function returns a String you can embed directly in a view or concatenate with other styled text. The styling helpers (bold, faint, …) wrap their argument and reset afterwards, so they nest cleanly.

Values

pub fn bg(index: Int) -> String

A 256-colour background escape for an xterm colour index (0–255).

pub fn bg_rgb(r: Int, g: Int, b: Int) -> String

A truecolor (24-bit) background escape for an RGB triple (each 0–255).

pub fn bold(text: String) -> String

Render text in bold.

pub fn clear() -> String

Clear the whole screen.

pub fn clear_below() -> String

Clear from the cursor to the end of the screen.

pub fn clear_line() -> String

Clear from the cursor to the end of the current line.

pub fn faint(text: String) -> String

Render text faint/dim.

pub fn fg(index: Int) -> String

A 256-colour foreground escape for an xterm colour index (0–255).

pub fn fg_rgb(r: Int, g: Int, b: Int) -> String

A truecolor (24-bit) foreground escape for an RGB triple (each 0–255).

pub fn hide_cursor() -> String

Hide the cursor.

pub fn home() -> String

Move the cursor to the top-left corner.

pub fn italic(text: String) -> String

Render text in italics.

pub fn move(row: Int, col: Int) -> String

Move the cursor to a 1-indexed row and col.

pub fn reset() -> String

Reset all attributes (colour, bold, …).

pub fn reverse(text: String) -> String

Render text with foreground/background reversed.

pub fn rule(width: Int) -> String

A horizontal rule: width box-drawing dashes ().

pub fn rule_of(width: Int, glyph: String) -> String

A horizontal rule of width repetitions of glyph.

pub fn show_cursor() -> String

Show the cursor.

pub fn underline(text: String) -> String

Render text underlined.

Search Document