ANSI escape sequence is a sequence of ASCII characters, the first two of which are the ASCII "Escape" character 27 (1Bh) and the left-bracket character " [ " (5Bh). The character or characters following the escape and left-bracket characters specify an alphanumeric code that controls a keyboard or display function.
ANSI escape sequences distinguish between uppercase and lowercase letters.
Esc[Value;...;Valuem
Set Graphics Mode:
Calls the graphics functions specified by the following values. These specified functions remain active until the next occurrence of this escape sequence. Graphics mode changes the colors and attributes of text (such as bold and underline) displayed on the screen.
Text attributes | |
---|---|
0 | All attributes off |
1 | Bold on |
4 | Underscore (on monochrome display adapter only) |
5 | Blink on |
7 | Reverse video on |
8 | Concealed on |
Foreground colors | |
30 | Black |
31 | Red |
32 | Green |
33 | Yellow |
34 | Blue |
35 | Magenta |
36 | Cyan |
37 | White |
Background colors | |
40 | Black |
41 | Red |
42 | Green |
43 | Yellow |
44 | Blue |
45 | Magenta |
46 | Cyan |
47 | White |
Parameters 30 through 47 meet the ISO 6429 standard.
For example, cat a file color_ansi.txt in cygwin with TERM=ansi will display like this:
沒有留言:
發佈留言