Escape sequence
| Action
| Environments where supported
|
DOS ANSI.SYS
| Linux console
|
[nA
| Moves cursor up n rows
| X
| X
|
[nB
| Moves cursor down n rows
| X
| X
|
[nC
| Moves cursor right n columns
| X
| X
|
[nD
| Moves cursor left n columns
| X
| X
|
[y;xH
| Moves cursor to position (x, y). The upper left
corner of the screen is (1,1)
| X
| X
|
[2J
| Clears screen and moves cursor to home position (1,1)
| X
| X
|
[K
| Erases line; from cursor position (including character under cursor)
to end of line
| X
| X
|
[y;xf
| Same as [y;xH
| X
| X
|
[s
| Pushes current cursor position on an internal stack
| X
| X
|
[u
| Pops last cursor position saved by
[s
and moves cursor to that position
| X
| X
|
[im
[i;jm
[i;j;km
| Sets text attributes. i, j, and k may have
any of the following values:
i, j, k |
Attribute |
i, j, k |
Attribute |
0 |
All attributes off |
1 |
Bold |
4 |
Underscore (not supported on all displays) |
5 |
Blink |
7 |
Reverse video |
8 |
Concealed video on |
30 |
Foreground color: black |
31 |
Foreground color: red |
32 |
Foreground color: green |
33 |
Foreground color: yellow |
34 |
Foreground color: blue |
35 |
Foreground color: magenta |
36 |
Foreground color: cyan |
37 |
Foreground color: white |
40 |
Background color: black |
41 |
Background color: red |
42 |
Background color: green |
43 |
Background color: yellow |
44 |
Background color: blue |
45 |
Background color: magenta |
46 |
Background color: cyan |
47 |
Background color: white |
| X
| X
|