mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 17:03:45 +01:00
c0a1d18e3d
* feat: update #4455, regenerate commands' docs * chore: update make_docs script
1.1 KiB
1.1 KiB
title | layout | version |
---|---|---|
ansi | command | 0.59.0 |
Output ANSI codes to change color.
Signature
> ansi (code) --escape --osc --list
Parameters
code
: the name of the code to use like 'green' or 'reset' to reset the color--escape
: escape sequence without the escape character(s)--osc
: operating system command (ocs) escape sequence without the escape character(s)--list
: list available ansi code names
Examples
Change color to green
> ansi green
Reset the color
> ansi reset
Use ansi to color text (rb = red bold, gb = green bold, pb = purple bold)
> echo [(ansi rb) Hello " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
Use ansi to color text (italic bright yellow on red 'Hello' with green bold 'Nu' and purble bold 'World')
> echo [(ansi -e '3;93;41m') Hello (ansi reset) " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
Use ansi to color text with a style (blue on red in bold)
> $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)"