Node:ANSI attribute codes, Up:Colors
ANSI attribute codes
An ANSI escape sequence has the format ESC[X;Ym
, where ESC
is
the escape character (octal 033). X
and, optionally, Y
, is
one of the following escape codes:
- attribute codes
- 00 = none
- 01 = bold
- 04 = underscore
- 05 = blink
- 07 = reverse
- 08 = concealed
- text color codes
- 30 = black
- 31 = red
- 32 = green
- 33 = yellow
- 34 = blue
- 35 = magenta
- 36 = cyan
- 37 = white
- background color codes
- 40 = black
- 41 = red
- 42 = green
- 43 = yellow
- 44 = blue
- 45 = magenta
- 46 = cyan
- 47 = white
For example, the sequence ESC[1;32myafc rulesESC[0m
will be the string
yafc rules
in bright green, after which the attribute is restored to
normal.