Appendix B
This appendix provides a summary of VT100 family escape and control sequences. Sequences unique to the VT101, VT102, and VT131, and the VT125 are in Appendix C and Appendix D, respectively.
| Name | Character Mnemonic | Octal Code | Function |
|---|---|---|---|
| Null | NUL | 000 | Ignored when received (not stored in input buffer), used as a fill character. |
| Enquire | ENQ | 005 | Transmits answerback message. |
| Bell | BEL | 007 | Generates a bell tone. |
| Backspace | BS | 010 | Moves cursor to the left one character position, unless it is at the left margin, in which case no action occurs. |
| Horizontal Tab | HT | 011 | Moves cursor to the next tab stop, or to the right margin if there are no more tab stops. |
| Line Feed | LF | 012 | Causes a line feed or a new line operation. (Refer to line feed/new line mode.) |
| Vertical Tab | VT | 013 | Processed as LF. |
| Form Feed | FF | 014 | Processed as LF. |
| Carriage Return | CR | 015 | Moves cursor to left margin on the current line. |
| Shift Out | SO | 016 | Selects G1 character set, as designated by a select character set sequence. |
| Shift In | SI | 017 | Selects G0 character set, as designated by a select character set sequence. |
| Device Control 1 | DC1 | 021 | Processed as XON. Causes terminal to continue transmitting characters. |
| Device Control 3 | DC3 | 023 | Processed as XOFF. Causes terminal to stop transmitting all characters except XOFF and XON. |
| Cancel | CAN | 030 | If received during an escape or control sequence, sequence is cancelled and the substitution character is displayed. |
| Substitute | SUB | 032 | Processed as CAN. |
| Escape | ESC | 033 | Processed as a sequence introducer. |
| Delete | DEL | 177 | Ignored when received (not stored in input buffer). |
| Name | Mnemonic | Mode | Sequence |
|---|---|---|---|
| Line feed/new line | LMN | New line | ESC [ 20 h |
| Cursor key | DECCKM | Application | ESC [ ? 1 h |
| ANSI/VT52 | DECANM | ANSI | N/A |
| Column | DECCOLM | 132 column | ESC [ ? 3 h |
| Scrolling | DECSCLM | Smooth | ESC [ ? 4 h |
| Screen | DECSCNM | Reverse | ESC [ ? 5 h |
| Origin | DECOM | Relative | ESC [ ? 6 h |
| Auto wrap | DECAWM | On | ESC [ ? 7 h |
| Auto repeat | DECARM | On | ESC [ ? 8 h |
| Interlace | DECINLM | On | ESC [ ? 9 h |
|
||||||||||||||||||||||||||||||||||||||||||||
| * The last character of the sequence is lowercase L (1548). |
| Cursor | ANSI Character Generated | |
|---|---|---|
| Reset (Cursor) | Set (Application) | |
| Up | ESC [ A | ESC O A |
| Down | ESC [ B | ESC O B |
| Right | ESC [ C | ESC O C |
| Left | ESC [ D | ESC O D |
| Name | Mnemonic | Sequence |
|---|---|---|
| Alternate | DECKPAM | ESC = |
| Numeric | DECKPNM | ESC > |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * The last character of the sequence is lowercase L (1548). |
| Character Set | G0 Designator | G1 Designator |
|---|---|---|
| United Kingdom (UK) | ESC ( A |
ESC ) A |
| United States (USASCII) | ESC ( B |
ESC ) B |
| Special characters and line drawing set | ESC ( 0 |
ESC ) 0 |
| Alternate character ROM | ESC ( 1 |
ESC ) 1 |
| Alternate character ROM, special graphics characters | ESC ( 2 |
ESC ) 2 |
| Name | Mnemonic | Sequence |
| Single Shift 2 | SS2 | ESC N |
| Single Shift 3 | SS3 | ESC O |
| Name | Mnemonic | Sequence |
|---|---|---|
| Select graphic rendition (no attributes) | SGR | ESC [ m |
| Select graphic rendition (no attributes) | SGR | ESC [ 0 m |
| Select graphic rendition (select attributes, reverse video, or underline as determined by cursor SET-UP feature) | SGR | ESC [ 4 m |
| Select graphic rendition (select attribute, reverse video, or underline as determined by cursor SET-UP feature) | SGR | ESC [ 7 m |
| Name | Mnemonic | Sequence |
|---|---|---|
| Set top and bottom margins | DECSTBM | ESC [ Pt ; Pb r |
| Name | Mnemonic | Sequence |
|---|---|---|
| Cursor up | CUU | ESC [ Pn A |
| Cursor down | CUD | ESC [ Pn B |
| Cursor forward (right) | CUF | ESC [ Pn C |
| Cursor backward (left) | CUB | ESC [ Pn D |
| Cursor position | CUP | ESC [ Pl; Pc H |
| Cursor position (home) | CUP | ESC [ H |
| Horizontal and vertical position | HVP | ESC [ Pl; Pc f |
| Horizontal and vertical position (home) | HVP | ESC [ f |
| Index | IND | ESC D |
| Reverse index | RI | ESC M |
| Next line | NEL | ESC E |
| Save cursor (and attributes) | DECSC | ESC 7 |
| Restore cursor (and attributes) | DECRC | ESC 8 |
| Name | Mnemonic | Sequence |
|---|---|---|
| Horizontal tab set (at current column) | HTS | ESC H |
| Tabulation clear (at current column) | TBC | ESC [ g |
| Tabulation clear (at current column) | TBC | ESC [ 0 g |
| Tabulation clear (all tabs) | TBC | ESC [ 3 g |
| Name | Mnemonic | Sequence |
|---|---|---|
| Double-height top half | DECDHL | ESC # 3 |
| Double-height bottom half | DECDHL | ESC # 4 |
| Single-width single-height | DECSWL | ESC # 5 |
| Double-width single-height | DECDWL | ESC # 6 |
| Name | Mnemonic | Sequence |
|---|---|---|
| Erase in line (cursor to end of line) | EL | ESC [ K |
| Erase in line (cursor to end of line) | EL | ESC [ 0 K |
| Erase in line (beginning of line to cursor) | EL | ESC [ 1 K |
| Erase in line (entire line containing cursor) | EL | ESC [ 2 K |
| Erase in display (cursor to end of screen) | ED | ESC [ J |
| Erase in display (cursor to end of screen) | ED | ESC [ 0 J |
| Erase in display (beginning of screen to cursor) | ED | ESC [ 1 J |
| Erase in display (entire screen) | ED | ESC [ 2 J |
| Name | Mnemonic | Sequence |
|---|---|---|
| Device status report (request status of VT101) | DSR | ESC [ 5 n |
| Response: Terminal OK Terminal not OK |
DSR DSR |
ESC [ 0 nESC [ 3 n |
| Device status report (report cursor position | DSR | ESC [ 6 n |
| Report cursor position | CPR | ESC [ Pl; Pc R |
| Device attributes (what are you) | DA | ESC [ c |
| Device attributes (what are you) | DA | ESC [ 0 c |
| Identify terminal (what are you) | DECID | ESC Z (not recommended) |
| Device attributes Response | DA | ESC [ ? 1 ; Ps 0c |
| Name | Mnemonic | Sequence |
|---|---|---|
| Reset to initial state | RIS | ESC c |
| Name | Mnemonic | Sequence |
|---|---|---|
| Screen alignment display (Fill screen with "Es") |
DECALN | ESC # 8 |
| Invoke confidence test (power-up test) | DECTST | ESC [ 2; 1 y |
| Invoke confidence test (Data loopback test, requires test connector) |
DECTST | ESC [ 2; 2 y |
| Invoke confidence test (repeat power-up test continuously until failure or power-off) |
DECTST | ESC [ 2; 9 y |
| Invoke confidence test (repeat data loopback test continuously until failure or power-off, requires test connector) |
DECTST | ESC [ 2; 10 y |
| Name | Mnemonic | Sequence |
|---|---|---|
| Load LEDs (all off) |
DECLL | ESC [ 0 q |
| Load LEDs (L1 on) |
DECLL | ESC [ 1 q |
| Load LEDs (L2 on) |
DECLL | ESC [ 2 q |
| Load LEDs (L3 on) |
DECLL | ESC [ 3 q |
| Load LEDs (L4 on) |
DECLL | ESC [ 4 q |
| Name | Sequence |
|---|---|
| Enter ANSI mode | ESC < |
| Name | Sequence |
|---|---|
| Enter alternate keypad mode | ESC = |
| Exit alternate keypad mode | ESC > |
| Name | Sequence |
|---|---|
| Special graphics character set | ESC F* |
| Select US/UK character set (as determined by US/UK character SET-UP feature) | ESC G |
| Name | Sequence |
|---|---|
| Cursor up† | ESC A |
| Cursor down† | ESC B |
| Cursor right† | ESC C |
| Cursor left† | ESC D |
| Cursor to home | ESC H |
| Direct cursor address | ESC Y Pl Pc‡ |
| Reverse line feed | ESC I |
† Same when sent from the terminal.
‡ Line and column numbers for direct cursor address are single character codes whose values are the desired number plus (378). Line and column numbers start at one.
| Name | Sequence |
|---|---|
| Erase to end of line | ESC K |
| Erase to end of screen | ESC J |
| Name | Sequence |
|---|---|
| Identify (what are you) | ESC Z |
| Response | ESC / Z |