Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 1.81 KB

File metadata and controls

62 lines (49 loc) · 1.81 KB
title ansi strip
categories platform
version 0.112.0
platform Strip ANSI escape sequences from a string.
usage Strip ANSI escape sequences from a string.
editLink false
contributors false

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
hello

Strip 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  │
╰───┴──────────┴─────────╯