Constant references to many widely-supported `ANSI` escape codes. Primarily used in terminal emulators for enhanced graphics, such as colors, text styling, and animated displays. For example, you can print out a line of cyan text like this: fmt.println(ansi.CSI + ansi.FG_CYAN + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR) Multiple SGR (Select Graphic Rendition) codes can be joined by semicolons: fmt.println(ansi.CSI + ansi.BOLD + ";" + ansi.FG_BLUE + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR) If your terminal supports 24-bit true color mode, you can also do this: fmt.println(ansi.CSI + ansi.FG_COLOR_24_BIT + ";0;255;255" + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR) For more information, see: - [[ https://en.wikipedia.org/wiki/ANSI_escape_code ]] - [[ https://www.vt100.net/docs/vt102-ug/chapter5.html ]] - [[ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html ]]

Collection Info

View Source
Collection
core
Path
terminal/ansi
Entries
110

Source Files

Constants

110

BG_BRIGHT_BLACK #

Source
BG_BRIGHT_BLACK :: "100"

Also known as grey.

BG_COLOR_24_BIT #

Source
BG_COLOR_24_BIT :: "48;2"

Followed by ";r;g;b" where r,g,b are in 0..=255

BG_COLOR_8_BIT #

Source
BG_COLOR_8_BIT :: "48;5"

Followed by ";n" where n is in 0..=255

CLIPBOARD #

Source
CLIPBOARD :: "52"

Followed by ";c;<Base64-encoded string>" ST.

DECTCEM_HIDE #

Source
DECTCEM_HIDE :: "?25l"

Text Cursor Enable Mode (Invisible)

DECTCEM_SHOW #

Source
DECTCEM_SHOW :: "?25h"

Text Cursor Enable Mode (Visible)

FG_COLOR_24_BIT #

Source
FG_COLOR_24_BIT :: "38;2"

Followed by ";r;g;b" where r,g,b are in 0..=255

FG_COLOR_8_BIT #

Source
FG_COLOR_8_BIT :: "38;5"

Followed by ";n" where n is in 0..=255

HYPERLINK #

Source
HYPERLINK :: "8"

Followed by ";[params];<URI>" ST. Closed by OSC HYPERLINK ";;" ST.

UNDERLINE_DOUBLE #

Source
UNDERLINE_DOUBLE :: "21"

May be interpreted as "disable bold."