ansi strip for platform
Strip ANSI escape sequences from a string.
Signature
> ansi strip {flags} ...rest
Parameters
...rest: For a data structure input, remove ANSI sequences from strings at the given cell paths.
Input/output types:
| input | output |
|---|---|
| string | string |
| list<string> | list<string> |
| table | table |
| record | record |
Examples
Strip ANSI escape sequences from a string
> $'(ansi green)(ansi cursor_on)hello' | ansi strip
helloStrip ANSI escape sequences from a record field
> { greeting: $'hello (ansi red)world' exclamation: false } | ansi strip greeting
╭─────────────┬─────────────╮
│ greeting │ hello world │
│ exclamation │ false │
╰─────────────┴─────────────╯Strip ANSI escape sequences from multiple table columns
> [[language feature]; [$'(ansi red)rust' $'(ansi i)safety']] | ansi strip language feature
╭───┬──────────┬─────────╮
│ # │ language │ feature │
├───┼──────────┼─────────┤
│ 0 │ rust │ safety │
╰───┴──────────┴─────────╯