ANSI VT-100 Escape sequences Compiled by Timothy Miller This is a list of all the ANSI escape sequences that I could find. Not all of them are supported by TWS's ANSITERM, but I have marked which ones are and which are not. Spaces are only for clarity. represents ASCII #27 non-printing character. CPR Cursor Position Report [ Row ; Col R Terminal responce to DSR. CUB Cursor Backwards [ n D Moves cursor n positions to the left. If n=0, default is 1. If attempt is made to move beyond margin, cursor stops ar margin. CUD Cursor Down [ n B Moves cursor n positions down. If n=0, default is 1. If attempt is made to move beyond margin, cursor stops ar margin. CUF Cursor Forward [ n C Moves cursor n positions to the right. If n=0, default is 1. If attempt is made to move beyond margin, cursor stops ar margin. CUU Cursor Up [ n A Moves cursor n positions up. If n=0, default is 1. If attempt is made to move beyond margin, cursor stops ar margin. CUP Cursor Position [ Row ; Col H Moves cursor to position on screen. Columns numbered 1-80, Rows 1-24 unless margins set otherwise. If parameter is 0 or missing, 1 is default. DA Device Attributes [ n c n should be 0 or missing. Terminal responds: [ ? 1 ; 2 c For ANSI/VT-100 terminal w/o printer [ ? 1 ; 11 c " " " w/ printer DCH Delete Characters [ n P Causes n characters to be removed from the right of the cursor, including the cursor. ANSITERM moves the characters to the right of the deleted field to be moved left to fill in the empty space. Spaces to the right of the moved block are filled with blanks with the same character attributes as the last moved character. DECALN Screen Alignment Display # 8 Causes the screen to be filled with uppercase E's to assist in alligning the screen display. Not supported by ANSITERM. DECANM ANSI/VT52 Mode [ ? 2 l Causes the terminal to switch to VT-52 mode. VT-52 is not supported by ANSITERM. DECARM Auto Repeat Mode [ ? 8 h (on) [ ? 8 l (off) Turns key auto-repeat on or off. Not supported by ANSITERM: auto-repeat is always on. DECAWM Autowrap Mode [ ? 7 h (on) [ ? 7 l (off) Turns end-of-line wrap on or off. When off, any characters displaying at the right margin will replace any character already there. When on, these characters appear at the beginning of the next line. DECCKM Cursor Keys Mode [ ? 1 h (application) [ ? 1 l (cursor) In application mode, the cursor keys send the following codes: left O D down O B right O C up O A In cursor mode (the default), the cursor keys send: left [ D down [ B right [ C up [ A DECCOLM Column Mode [ ? 3 h (132 columns) [ ? 3 l (80 columns) 132 column mode is not supported by ANSITERM. DECDHL Double Height Line Top half: # 3 Bottom half: # 4 Causes the whole current line to change to double-width, double-height top-half or bottom-half. If the line was normal, all characters to the right of the center of the screen are lost. Cursor remains at the same position unless it would be placed beyond the right margin, in which case, it would be placed at the right margin. Double height is not supported by ANSITERM. DECDWL Double Width Line # 6 Causes the current line to become double-width, normal-height. If the line was normal, all characters to the right of the center of the screen are lost. Cursor remains at the same position unless it would be placed beyond the right margin, in which case, it would be placed at the right margin. Double width is not supported by ANSITERM. DECEDM Editing Mode [ ? 10 h (edit) [ ? 10 l (interactive) In edit mode, characters are only sent when you press return (I think). Interactive mode is normal. ANSITERM does not support Editing mode. DECEKEM Edit Key Execution Mode [ ? 16 h (immediate) [ ? 16 l (defer) In immediate state, if the user puts the terminal in edit mode, the host computer is told. In the defer state, if the user attempts to put the terminal in edit mode, the host computer is asked first. ANSITERM is not an editing terminal. DECID Identity Terminal Z Same as DA, never use this. ANSITERM doesn't support it either. DECINLM Interlace Mode [ ? 9 h (on) [ ? 9 l (off) ANSITERM ignores this command. DECKPNM Keypad Numeric Mode > Causes the numeric keypad to send the characters which appear on the keytops. DECKPAM Keypad Application Mode = Causes the numeric keypad to transmit the following sequences: (PF1) (PF2) (PF3) (PF4) '(' O P ')' O Q '/' O R '*' O S '7' O w '8' O x '9' O y '-' O m '4' O t '5' O u '6' O v '+' O 1 '1' O q '2' O r '3' O s '0' O p '.' O n ENTER O M On some terminals, there is a TAB key in place of a '+' key, and PF1 - PF4 are the top row of keys. DECLL Load LED's [ n q Depending on n, the following action is preformed: 0 Clear LED's 1 and 2 1 Set LED 1 2 Set LED 2 LED's are not supported by ANSITERM. DECLTM Line Transmit Mode [ ? 11 h (line) [ ? 11 l (page) In edit mode, line, page, or partial page is transmitted by the terminal. Edit mode is not supported by ANSITERM. DECXMIT Transmit 5 Causes the terminal to transmit the line being edited as if the user had pressed return to send it. Edit mode is not supported by ANSITERM. DECOM Origin Mode [ ? 6 h (relative) [ ? 6 l (absolute) In relative mode, cursor positions are numbered with respect with the current scrolling region. In absolute mode, cursor positions are numbered with respect to the whole screen. DECPRO Protected Field Attributes [ n ; ... ; n } According to n, sets the following: 0 no fields are protected 1 bold implies protection 4 underline implies protection 5 blinking implies protection 7 reverse video implies protection 254 all attributes off (normal) implies protection Since ANSITERM is not an editing terminal, it does not support field protection. DECSC Save Cursor 7 (standard) [ s (this must be VT-102 only) Saves current cursor position and printing attributes. ANSITERM only saves position. DECRC Restore Cursor 8 (standard) [ u (this must be VT-102 only) Restores cursor to a previously stored position. DECREQTPARM Request Terminal Parameters [ n x n will be 0 or 1. Terminal responds with DECREPTPARM. DECREPTPARM Report Terminal Parameters [ sol ; par ; nbits ; xspeed ; rspeed ; clkmul ; flags x Terminal's responce to DECREQTPARM. Parameters are: sol : is DECREQTPARM's n is 0, sol = 2. If n is 1, sol = 3 par : parity: 1 none 2 space 3 mark 4 odd 5 even ANSITERM sends 1 nbits: 1 for 8 bits, 2 for 7 bits per char (default 1) xspeed, rspeed: code baud 0 50 8 75 16 110 24 134.5 32 150 40 200 48 300 56 600 64 1200 72 1800 80 2000 88 2400 96 3600 104 4800 112 9600 120 19200 clkmul: 1 (bit rate multiplier is 16) flag: 0-15 (ignored) DECSCFDM Space Compression/Field Delimiting Mode [ ? 13 h (on) [ ? 13 l (off) Sets mode for sending data in edit mode. ANSITERM does not support edit mode. DECSCLM Scrolling Mode [ ? 4 h (smooth) [ ? 4 l (jump) ANSITERM does not support smooth scrolling. DECSCNM Screen Mode [ ? 5 h (normal) [ ? 5 l (reverse) In normal mode, the screen text is light on dark. In reverse mode, the screen text is dark on light. ANSITERM is always in normal mode. DECSTBM Set Top and Bottom Margins [ top ; bottom r Sets top and bottom margins of scrolling region. DECSWL Single-Width Line ESC # 5 Sets current line to normal width and heigth. Not supported by ANSITERM DECTEM Transmit Execution Mode [ ? 14 h (immediate) [ ? 14 l (defer) In edit mode, immediate sends line or field being edited when user presses return. Defer mode asks the host first by sending an S sequence. The terminal will only then send the line if the host sends a DECXMIT command. ANSITERM does not support edit mode. DECTST Invoke Confidence Test [ 2 ; n y Performs tests on the terminal. n indicates the text to be done and is calculated by adding together one or more of the following values: Power up self-test (EPROM and EAROM cksums, RAM test, keyboard test) 1 Data loopback test (loopback connector required) 2 EIA modem loopback test (loopback connector requited) 4 Repeat selected test(s) indefinitely (until failure or power off) 8 ANSITERM supports none of these tests. DECTTC Transmit Termination Character [ n | Where n is one of the following: 0 none (function disabled) 1 FF (form feed) ANSITERM ignores this. DL Delete Line [ n M n lines are deleted, including the line which the cursor is on. Lines below are moved up, and new blank lines appear at the bottom. DSR Device Status Report [ x n Where n is actually a literal n, and x is one of the following: 0 terminal responce - no malfunction 3 terminal responce - malfunction - retry 5 command from host - report status using DSR 6 command from host - report cursor position with CPR The host sends a request using options 5 or 6, and the terminal responds with " [ 0 n" or a CPR sequence, respectively. ED Erase in Display [ n J Erases characters in the display, with n specifying one of the following: 0 Erase from the cursor position to the end of the display, inclusive. 1 Erase from the start of the display to the cursor position, inclusive. 2 Erase the entire display. ANSITERM resets screen attributes to normal, but leaves the drawing attributes for new characters set as before. EL Erase Line [ n K Erases characters in the line according to n: 0 Erase from the cursor position to the end of the line, inclusive. 1 Erase from the start of the line to the cursor position, inclusive. 2 Erase entire line. ERM Erasure mode [ 6 h (erase all) [ 6 l (erase unprotected) In the reset state (erase unprotected), only unprotected characters on the screen can be cleared with ED or EL. In the set state (erase all), any characters on the screen can be cleared with ED or EL. ANSITERM is not an editing terminal and does not support this. GATM Guarded Area Transmit [ 1 h (send all) [ 1 l (send unprotected) In the reset state, only unprotected fields are transmitted to the host when requested (seperated by record separator when a protected field is encountered. In the set state, all is transmitted. ANSITERM is not an editing terminal and does support this. HTS Horizontal Tabulation Set H Sets a horizontal tab stop at the current cursor column. HVP Horizontal and Vertical Position [ row ; col f Moves the cursor to a specified position on the screen. IL Insert Line [ n L Moves all lines below and including the one the cursor is on down n lines, discards all lines that scroll off the bottom of the display, and inserts blank lines into the empty space. IND Index D Acts same as a linefeed. Moves cursor down, maintaining the same column, and if the cursor is at the bottom of the scrolling region, a scroll up is preformed. IRM Insert/Replacement Mode [ 4 h (insert) [ 4 l (replace) In insert mode, when a character is displayed all characters on the line to the right of the cursor are moved right before the character is displayed. Any character at the right most column is discarded. In the replace mode (normal), any character at the cursor position is overwritten by any new received character. KAM Keyboard Action Mode [ 2 h (disabled) [ 2 l (enabled) Enables or disables the keyboard. ANSITERM does not support this. LNM Line Feed/New Line Mode [ 20 h (new line)(on) [ 20 l (line feed)(off) In line feed mode, line feed only implies vertical movement and a carriage return is required to return to the left most column. The return key sends only a carriage return in this mode. In the new line mode, line feed implies both vertical movement and return to the left most column. In this mode, the return key sends both carriage return and line feed. New line mode does not affect IND or NEL. NEL Next Line E This causes the cursor to move to the left most column of the next line. Same as carriage return followed by line feed. NP Next Page [ n U Causes the nth page down to be displayed. ANSITERM does not support more than one display page. RI Reverse Index M Causes the cursor to move to the same column of the preceding line. If the cursor is at the top of the scrolling region, a scroll down if preformed. RIS To Initial State c Resets the terminal to its power up state. RM Reset Mode [ n; n; n; ... n l Resets one or more modes specified by each individual n. See above sequences for examples of RM sequences. SCS Select Character Set Selects a character set. One of two sets may be selected quickly after being set with the following sequences: Shift In (Ctrl-N) Shift Out (Ctrl-O) (A )A United Kingdom (B )B Ascii (0 )0 Business Graphics Any selection other than A, B, or 0 will default to Ascii. ANSITERM supports only Ascii and IBMECGS character sets. SGR Select Graphics Rendition [ n; ... n m This sequence sets one or more character drawing attribute according to the following table: VT-100 Commands n Meaning 0 all attributes off 1 bold 4 underline (NOW supported by ANSITERM) 5 blink (IS supported by ANSITERM) 7 reverse video VT-102 Commands 30+c foreground color 40+c background color where c is one of the following: 0 black 1 red 2 green 3 brown/yellow 4 blue 5 magenta 6 cyan 7 grey/white SM Set Mode [ n; ... ; n h Sets one or more modes specified by each individual n. See above sequences for examples of SM sequences. TBC Tabulation Clear [ n g Clears horizontal tab stops according to n: 0 clear tab at cursor position 3 clear all tabs TTM Transfer Termination Mode [ 16 h (page) [ 16 l (partial page) This is an edit mode command. In the set state, the entire scrolling region is transmitted. In the reset state, all characters from the beginning of the scrolling region or the last partial page, to (but not including) the cursor position are transmitted. ANSITERM is not an editing terminal. Here's one I didn't find until I picked it out of my capture buffer: ??? Insert Char [ n @ This is what one version of SearchLight BBS sends when it's trying to insert a character. I'm just assuming that you can add that optional n parameter to specify how many characters to insert. What I actually found was just an [@ where it unsuccessfully tried to insert.