Terminal Emulator Control Sequences  
 
Terminal Control Sequences
<ESC>c Reset display to initial state
<ESC>8 Display alignment test
Cursor Control Sequences
<ESC>D Move cursor down to next line
<ESC>E Move cursor to first column and down one line
<ESC>M Move cursor up one line
<ESC>7 Save cursor position, attributes and colors
<ESC>8 Restore saved cursor position, attributes and colors
<ESC>[nA Move cursor up n lines
<ESC>[nB Move cursor down n lines
<ESC>[nC Move cursor forward n spaces
<ESC>[nD Move cursor backward n spaces
<ESC>[nE Move cursor to beginning of line, down n lines
<ESC>[nF Move cursor to beginning of line, up n lines
<ESC>[xG Move cursor to column x
<ESC>[y;xH Move cursor to line y, column x
<ESC>[nI Move cursor forward n tabstops
<ESC>[nZ Move cursor backwards n tabstops
<ESC>[na Move cursor forward n spaces
<ESC>[yd Move cursor to row y
<ESC>[ne Move cursor down n lines
<ESC>[y;xf Move cursor to line y, column x
<ESC>[s Save cursor position
<ESC>[u Return to saved cursor position
<ESC>[x` Move cursor to column x
Attribute and Color Sequence
<ESC>[nm Select display attributes and color
n Value Description
0 Reset to default attributes and colors
1 Bold attribute
2 Dim attribute
4 Underline attribute
5 Blink attribute (same as reverse)
7 Reverse attribute
8 Hidden attribute
22 Clear bold attribute
24 Clear underline attribute
25 Clear blink attribute
27 Clear reverse attribute
29 Clear color attributes
30 Black foreground
31 Red foreground
32 Green foreground
33 Yellow foreground
34 Blue foreground
35 Magenta foreground
36 Cyan foreground
37 White foreground
40 Black background
41 Red background
42 Green background
43 Yellow background
44 Blue background
45 Magenta background
46 Cyan background
47 White background
Character Set Sequences
<ESC>(A Assign ISO Latin 1 character set to font bank G0
<ESC>(B Assign United States ASCII character set to font bank G0
<ESC>(0 Assign graphics character set to font bank G0
<ESC>)A Assign ISO Latin 1 character set to font bank G1
<ESC>)B Assign United States ASCII character set to font bank G1
<ESC>)0 Assign graphics character set to font bank G1
Erase Sequences
<ESC>[n@ Insert n blank spaces
<ESC>[nJ Erase all or part of the display
n Value Description
0 From current position to end of display
1 From beginning of display to current position
2 Erase the entire display
<ESC>[nK Erase all or part of a line
n Value Description
0 From current position to end of line
1 From beginning of line to current position
2 Erase the entire line
<ESC>[nL Insert n new blank lines
<ESC>[nM Delete n lines from current cursor position
<ESC>[nP Delete n characters from current cursor position
Scrolling Sequences
<ESC>[nS Scroll display up n lines
<ESC>[nT Scroll display down n lines
<ESC>[nX Erase n characters from the current position
<ESC>[y1;y2r Set scrolling region from lines y1 to y2
Keypad Sequences
<ESC>= Place keypad into applications mode
<ESC>> Place keypad into numeric mode
Emulation Option Sequences
<ESC>[?nh Set emulation option
n Value Description
1 Enable cursor key application mode
2 Enable ANSI escape sequences
5 Reverse foreground and background colors
6 Enable origin mode
7 Enable auto-wrap mode
20 Enable linefeed/newline mode
25 Display caret
66 Place keypad in applications mode
<ESC>[?n1 Set emulation option
n Value Description
1 Disable cursor key application mode
2 Enable VT52 escape sequences
5 Restore foreground and background colors
6 Disable origin mode
7 Disable auto-wrap mode
20 Disable linefeed/newline mode
25 Hide caret
66 Place keypad in numeric mode
Console Escape Sequences
<ESC>[=nA Set the overscan color (ignored)
<ESC>[=n1;n2B Set bell sound (parameters ignored)
<ESC>[=n1;n2C Set the caret size
<ESC>[=nD Set background color intensity
n Value Description
0 Decrease background color intensity
1 Increase background color intensity
<ESC>[=nE Set blink vs. bold attribute (ignored)
<ESC>[=nF Set normal foreground color
<ESC>[=nG Set normal background color
<ESC>[=nH Set reverse foreground color
<ESC>[=nI Set reverse background color
<ESC>[=nJ Set graphics foreground color
<ESC>[=nK Set graphics background color
n Value Description
0 Black
1 Blue
2 Green
3 Cyan
4 Red
5 Magenta
6 Brown
7 White
8 Gray
9 Light blue
10 Light green
11 Light cyan
12 Light red
13 Light magenta
14 Yellow
15 High White
Control Character Sequences
<CTL>G Ring audible bell, if enabled
<CTL>H Move cursor one character backwards
<CTL>I Move cursor forward to next tabstop
<CTL>J Move cursor down to next line
<CTL>M Move cursor to beginning of line
<CTL>N Select G1 character set
<CTL>O Select G0 character set
<CTL>Z Abort current escape sequence
<DEL> Erase and move cursor one character backwards