tur/term-string
stdlib/term-string.tur
owned String siblings for the tur/term ANSI colorizers.
Since: v2 (string-adoption-stdlib-plan, batch 3)
defn
term/bold-string
(term/bold-string [s : cstr] :)
wrap a string in ANSI bold codes, as an owned String.
Parameters
| s | NUL-terminated cstr to colorize |
Returns
An owned String with ANSI bold (on a tty) or a plain copy (non-tty).
Example
(string/to-cstr (term/bold-string "hi")) ; => "\x1b[1mhi\x1b[0m" (on a tty)
Since: v2
defn
term/dim-string
(term/dim-string [s : cstr] :)
wrap a string in ANSI dim codes, as an owned String.
Since: v2
defn
term/red-string
(term/red-string [s : cstr] :)
wrap a string in ANSI red codes, as an owned String.
Since: v2
defn
term/green-string
(term/green-string [s : cstr] :)
wrap a string in ANSI green codes, as an owned String.
Since: v2
defn
term/yellow-string
(term/yellow-string [s : cstr] :)
wrap a string in ANSI yellow codes, as an owned String.
Since: v2
defn
term/blue-string
(term/blue-string [s : cstr] :)
wrap a string in ANSI blue codes, as an owned String.
Since: v2
defn
term/cyan-string
(term/cyan-string [s : cstr] :)
wrap a string in ANSI cyan codes, as an owned String.
Since: v2