The following controls are processed only if the ANSI option is enabled
in the current session. These controls are designed to be ANSI X3.64-1979
compliant, and are based on the AIXTERM and DEC-VT102 controls. They are
an extension to the ANSI controls supported in DOS and OS/2 2.x. Those controls
labeled (DOS) are also supported in DOS ANSI.SYS.
Where the # is shown, it can be replaced with a number. When a value is
not given, it defaults to 1 for counts and 0 for positions and options.
Columns and rows are numbered starting at 1. Controls are parsed as specified
by ANSI X3.64. In addition, the VT100 syntax (ANSI X3.41-1974) is also allowed.
Only the 7-bit control formats can be used. Controls which are not in the
list below are parsed and ignored.
Control
Esc
(0x1b)
Escape. This character introduces a control
sequence. If the following character is less than space, it is placed in
the datastream, otherwise it is considered a control sequence.
Esc[#@
Insert character. Insert # characters at the current
position. The rest of the line is shifted over n characters.
Esc[#A
Cursor up. Move the cursor up # lines. If at top
of the screen do nothing. The default number of lines is one. (DOS)
Esc[#B
Cursor down. Move the cursor down # lines. If at
the bottom of the screen do nothing. The default number of lines is one.
(DOS)
Esc[#C
Cursor forward.
Move the cursor to the right # position. If at the edge of the screen do
nothing. The default number of positions is one. (DOS)
Esc[#D
Cursor back. Move the cursor to the left # positions.
If at the edge of the screen do nothing. The default number of positions
is one. (DOS)
Esc[#E
Cursor
next line. Move the cursor to the beginning of the next line or lines. Scroll
if necessary.
Esc[#F
Cursor
previous line. Move the cursor to the beginning of the previous line or
lines. Scroll if necessary.
Esc[#G
Cursor
set column. Move the cursor to the # column on the current line. If the
current line has fewer columns, move the cursor to the end of the line.
The default column is 1.
Esc[#;#H
Cursor
set row and column. Set the cursor row and column. The first parameter gives
the row, and the second parameter gives the column. The default for each
parameter is one. (DOS)
Esc[#I
Cursor
horizontal tab. Move the cursor to the next tab stop. The default count
or 0 give the next tab stop, a parameter of 1 or greater gives the count
of tab stops after that one.
Esc[0J
Erase
display from cursor to bottom.
Esc[1J
Erase
display from top to cursor.
Esc[2J
Erase
entire display. The cursor is moved to the top left corner of the display.
(DOS)
Esc[0K
Erase line
from cursor to end. (DOS)
Esc[1K
Erase
line from start to cursor
Esc[2K
Erase
the entire line. The cursor is moved to the beginning of the line.
Esc[#L
Insert line. Insert lines after the current line.
This causes line below this to be scrolled down.
Esc[#M
Delete line. Delete lines starting with the current
line and going down. This causes the area below this to be scrolled up.
Esc[0O
Erase scroll area
from cursor to bottom.
Esc[1O
Erase
scroll area from top to cursor.
Esc[2O
Erase
entire scroll area. The scroll area is set using Esc[r
Esc[#P
Delete character. Delete the current character.
This causes the rest of the line to be moved.
Esc[#S
Scroll up. Scroll up the current scrolling area.
Lines at the bottom are erased.
Esc[#T
Scroll
down. Scroll down the current scrolling area. Lines at the top are erased.
Esc[#X
Erase character.
Erase characters starting at the current position. Leave the cursor position
unchanged.
Esc[#Z
Cursor
backtab. Move the cursor back the specified number of tabs. The default
value of zero is to the previous tab.
Esc[#`
Set
absolute horizontal cursor position. The current row is unchanged. This
is the same as Esc[#G
Esc[#a
Set
relative horizontal cursor position. The current row is unchanged. This
is the same as Esc[#C
Esc[c
Request
device attributes. This causes the string Esc[=20;2;2c to be placed in the
input.
Esc[#d
Set absolute
vertical cursor position. The current column is unchanged.
Esc[#e
Set relative vertical cursor position. The current
column is unchanged. This is the same as Esc[#B
Esc[#;#f
Set cursor position row and column. This is the
same as Esc[H.
Esc[0g
Clear
tab at current column.
Esc[3g
Esc[4h
Esc[20h
Set linefeed
newline mode. Linefeed characters move the cursor
to the first position of the next line.
Esc[4l
Esc[20l
Reset
linefeed newline mode. Linefeed characters move the cursor down one line.
Esc[0m
Set normal text.
This is set to the color of the last Esc[=0m. (DOS)
Esc[1m
Esc[4m
Set underscore text. Not all displays support this.
(DOS)
Esc[5m
Set blink
text. Not all displays support this. (DOS)
Esc[7m
Set reverse text. This is the reverse of the current
color. (DOS)
Esc[8m
Esc[10m
Esc[11m
Esc[#;#m
Set
text color. The following colors can be specified. Multiple can be specified
together to give both a foreground and background color. (DOS)
52 Light-green
foreground
55 Light-magenta foreground
57 Light-white foreground
Esc[6n
Request cursor position.
Place the current cursor position in the input buffer as Esc[#;#R. (DOS)
Esc[#;#r
Set top and bottom
margins. The first parameter gives the top of the scrolling area, and the
second parameter gives the bottom of the scrolling area.
Esc[s
Save cursor. The current cursor location is saved
and can be restored with Esc[u. Only one location is saved. This also saves
the cursor visibility and bell. (DOS)
Esc[u
Restore
cursor. Set the cursor to the saved location. (DOS)
Esc[0v
Set cursor to underline cursor visible.
Esc[1v
Esc[2v
Set cursor to block cursor and visible.
Esc[?7h
Set wrap mode. When the end of the line is reached
do an automatic new line. For insert and delete characters scroll the rest
of the display. (DOS)
Esc[?7l
Set
nowrap mode. When the end of the line is reached do not do an automatic
new line. For insert and delete characters only affect the current line.
(DOS)
Esc[=#;#B
Set bell
tone. The pitch is given as a value indicating frequency in Hertz (0 is
quiet). The second value gives the duration in 1/100 seconds. This can be
0 to 250.
Esc[=#;#,#D
Set
display size. There are three values. The first gives the number of columns,
and the second gives the number of rows. The actual size may differ from
what is specified. The optional third value gives the attribute format.
0=VGA, 1=Extended, 2=Unicode.
Esc[=3h
Set
the display to an 80x25 VGA text mode. This is the equivalent of Esc[=80;25D.
(DOS)
Esc[=7h
Set wrap
mode. When the end of the line is reached do an automatic new line. (DOS)
Esc[=#;#k
Set typomatic
rate. There are two values. The first gives the repeat rate per second (1-30),
and the second gives the delay time in 1/100 second (25-100). The typomatic
rate is set for all sessions.
Esc[=3l
Reset
mode extended. This is the same as Esc[=3h. (DOS)
Esc[=7l
Set nowrap mode. When the end of the line is reached
do not do an automatic new line. (DOS)
Esc[=0m
Make the current color the default text color.
Esc[=9m
Reset the default text color.
Esc7
Save cursor (VT100). Same as Esc[s.
Esc8
Restore cursor (VT100). Same as Esc[u.
Esc=
Numlock off (VT100). Turns off the numlock on the
keyboard.
Esc >
Numlock
on (VT100). Turns on the numlock on the keyboard.
EscD
Index. Move cursor down one line scrolling if necessary.
EscE
New line. Move the
cursor to the beginning of the next line.
EscH
Set
horizontal tab. Set a tab at the current cursor position.
EscM
Reverse index. Move the cursor up one line, scrolling
if necessary.
Escc
Set all variables
to startup state.
Set the
video mode to a text mode with 80 columns and the current rows setting.
Set tabs to every 8 columns
Set
scroll area to the entire screen
Set to nowrap
and replace mode
Set bell
and cursor to defaults
[Back: Single Byte Controls]
[Next: Terminal Mode Keyboard]