1 Summary of ANSI standards for ASCII terminals Joe Smith, 18-May-84
4 1. Overview and Definitions
5 2. General rules for interpreting an ESCape Sequence
6 3. General rules for interpreting a Control Sequence
7 4. C0 and C1 control codes in numeric order
8 5. Two and three-character ESCape Sequences in numeric order
9 6. Control Sequences in numeric order
10 7. VT100 emulation requirements
12 The VT100 USER GUIDE and ANSI standard X3.64-1979 both list the ANSI ESCape
13 sequences in alphabetic order by mnemonic, but do not have a have a cross
14 reference in order by ASCII code. This paper lists the combination of all
15 definitions from the three ANSI standards in numeric order. For a description
16 of the advantages of using these standards, see the article "Toward
17 Standardized Video Terminals" in the April-1984 issue of BYTE magazine.
19 ANSI X3.4-1977 defines the 7-bit ASCII character set (C0 and G0). It was
20 written in 1968, revised in 1977, and explains the decisions made in laying out
21 the ASCII code. In particular, it explains why ANSI chose to make ASCII
22 incompatible with EBCDIC in order to make it self-consistent.
24 ANSI X3.41-1974 introduces the idea of an 8-bit ASCII character set (C1 and G1
25 in addition to the existing C0 and G0). It describes how to use the 8-bit
26 features in a 7-bit environment. X3.41 defines the format of all ESCape
27 sequences, but defines only the 3-character ones with a parameter character
28 in the middle. These instruct the terminal how to interpret the C0, G0, C1,
29 and G1 characters (such as by selecting different character-set ROMs).
31 Note: NAPLPS does videotex graphics by redefining the C1 set and
32 selecting alternate G0, G1, G2, and G3 sets.
33 See the February 1983 issue of BYTE magazine for details.
35 ANSI X3.64-1979 defines the remaining ESCape sequences. It defines all the C1
36 control characters, and specifies that certain two-character ESCape sequences
37 in the 7-bit environment are to act exactly like the 8-bit C1 control set.
38 X3.64 introduces the idea of a Control-Sequence, which starts with CSI
39 character, has an indefinite length, and is terminated by an alphabetic
40 character. The VT100 was one of the first terminals to implement this
45 Control Character - A single character with an ASCII code with the range
46 of 000 to 037 and 200 to 237 octal, 00 to 1F and 80 to 9F hex.
48 Escape Sequence - A two or three character string staring with ESCape.
49 (Four or more character strings are allowed but not defined.)
51 Control Sequence - A string starting with CSI (233 octal, 9B hex) or
52 with ESCape Left-Bracket, and terminated by an alphabetic character.
53 Any number of parameter characters (digits 0 to 9, semicolon, and
54 question mark) may appear within the Control Sequence. The terminating
55 character may be preceded by an intermediate character (such as space).
56 \fCharacter classifications:
58 C0 Control 000-037 octal, 00-1F hex (G0 is 041-176 octal, 21-7E hex)
59 SPACE 040+240 octal, 20+A0 hex Always and everywhere a blank space
60 Intermediate 040-057 octal, 20-2F hex !"#$%&'()*+,-./
61 Parameters 060-077 octal, 30-3F hex 0123456789:;<=>?
62 Uppercase 100-137 octal, 40-5F hex @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
63 Lowercase 140-176 octal, 60-7E hex `abcdefghijlkmnopqrstuvwxyz{|}~
64 Alphabetic 100-176 octal, 40-7E hex (all of upper and lower case)
65 Delete 177 octal, 7F hex Always and everywhere ignored
66 C1 Control 200-237 octal, 80-9F hex 32 additional control characters
67 G1 Displayable 241-376 octal, A1-FE hex 94 additional displayable characters
68 Special 240+377 octal, A0+FF hex Same as SPACE and DELETE
70 Note that in this paper, the terms uppercase, lowercase, and alphabetics
71 include more characters than just A to Z.
73 ------------------------------------------------------------------------------
75 General rules for interpreting an ESCape Sequence:
77 An ESCape Sequence starts with the ESC character (033 octal, 1B hex).
78 The length of the ESCape Sequence depends on the character that immediately
81 If the next character is
82 C0 control: Interpret it first, then resume processing ESCape sequence.
83 Example: CR, LF, XON, and XOFF work as normal within an ESCape sequence.
84 Intermediate: Expect zero or more intermediates, a parameter terminates
85 a private function, an alphabetic terminates a standard sequence.
86 Example: ESC ( A defines standard character set, ESC ( 0 a DEC set.
87 Parameter: End of a private 2-character escape sequence.
88 Example: ESC = sets special keypad mode, ESC > clears it.
89 Uppercase: Translate it into a C1 control character and act on it.
90 Example: ESC D does indexes down, ESC M indexes up. (CSI is special)
91 Lowercase: End of a standard 2-character escape sequence.
92 Example: ESC c resets the terminal.
93 Delete: Ignore it, and continue interpreting the ESCape sequence
94 C1 and G1: Treat the same as their 7-bit counterparts
96 Note that CSI is the two-character sequence ESCape left-bracket or the 8-bit
97 C1 code of 233 octal, 9B hex. CSI introduces a Control Sequence, which
98 continues until an alphabetic character is received.
100 General rules for interpreting a Control Sequence:
102 1) It starts with CSI, the Control Sequence Introducer.
103 2) It contains any number of parameter characters (0123456789:;<=>?).
104 3) It terminates with an alphabetic character.
105 4) Intermediate characters (if any) immediately precede the terminator.
107 If the first character after CSI is one of "<=>?" (074-077 octal, 3C-3F hex),
108 then Control Sequence is to be interpreted according to private standards (such
109 as setting and resetting modes not defined by ANSI). The terminal should
110 expect any number of numeric parameters, separated by semicolons (073 octal,
111 3B hex). Only after the terminating alphabetic character is received should
112 the terminal act on the Control Sequence.
114 =============================================================================
115 C0 set of 7-bit control characters (from ANSI X3.4-1977).
117 Oct Hex Name * (* marks function used in DEC VT series or LA series terminals)
118 --- -- - --- - --------------------------------------------------------------
119 000 00 @ NUL * Null filler, terminal should ignore this character
120 001 01 A SOH Start of Header
121 002 02 B STX Start of Text, implied end of header
122 003 03 C ETX End of Text, causes some terminal to respond with ACK or NAK
123 004 04 D EOT End of Transmission
124 005 05 E ENQ * Enquiry, causes terminal to send ANSWER-BACK ID
125 006 06 F ACK Acknowledge, usually sent by terminal in response to ETX
126 007 07 G BEL * Bell, triggers the bell, buzzer, or beeper on the terminal
127 010 08 H BS * Backspace, can be used to define overstruck characters
128 011 09 I HT * Horizontal Tabulation, move to next predetermined position
129 012 0A J LF * Linefeed, move to same position on next line (see also NL)
130 013 0B K VT * Vertical Tabulation, move to next predetermined line
131 014 0C L FF * Form Feed, move to next form or page
132 015 0D M CR * Carriage Return, move to first character of current line
133 016 0E N SO * Shift Out, switch to G1 (other half of character set)
134 017 0F O SI * Shift In, switch to G0 (normal half of character set)
135 020 10 P DLE Data Link Escape, interpret next control character specially
136 021 11 Q XON * (DC1) Terminal is allowed to resume transmitting
137 022 12 R DC2 Device Control 2, causes ASR-33 to activate paper-tape reader
138 023 13 S XOFF* (DC2) Terminal must pause and refrain from transmitting
139 024 14 T DC4 Device Control 4, causes ASR-33 to deactivate paper-tape reader
140 025 15 U NAK Negative Acknowledge, used sometimes with ETX and ACK
141 026 16 V SYN Synchronous Idle, used to maintain timing in Sync communication
142 027 17 W ETB End of Transmission block
143 030 18 X CAN * Cancel (makes VT100 abort current escape sequence if any)
144 031 19 Y EM End of Medium
145 032 1A Z SUB * Substitute (VT100 uses this to display parity errors)
146 033 1B [ ESC * Prefix to an ESCape sequence
147 034 1C \ FS File Separator
148 035 1D ] GS Group Separator
149 036 1E ^ RS * Record Separator (sent by VT132 in block-transfer mode)
150 037 1F _ US Unit Separator
152 040 20 SP * Space (should never be defined to be otherwise)
153 177 7F DEL * Delete, should be ignored by terminal
155 ==============================================================================
156 \f C1 set of 8-bit control characters (from ANSI X3.64-1979)
158 Oct Hex Name * (* marks function used in DEC VT series or LA series terminals)
159 --- -- - --- - --------------------------------------------------------------
160 200 80 @ Reserved for future standardization
164 204 84 D IND * Index, moves down one line same column regardless of NL
165 205 85 E NEL * NEw Line, moves done one line and to first column (CR+LF)
166 206 86 F SSA Start of Selected Area to be sent to auxiliary output device
167 207 87 G ESA End of Selected Area to be sent to auxiliary output device
168 210 88 H HTS * Horizontal Tabulation Set at current position
169 211 89 I HTJ Hor Tab Justify, moves string to next tab position
170 212 8A J VTS Vertical Tabulation Set at current line
171 213 8B K PLD Partial Line Down (subscript)
172 214 8C L PLU Partial Line Up (superscript)
173 215 8D M RI * Reverse Index, go up one line, reverse scroll if necessary
174 216 8E N SS2 * Single Shift to G2
175 217 8F O SS3 * Single Shift to G3 (VT100 uses this for sending PF keys)
176 220 90 P DCS * Device Control String, terminated by ST (VT125 enters graphics)
177 221 91 Q PU1 Private Use 1
178 222 92 R PU2 Private Use 2
179 223 93 S STS Set Transmit State
180 224 94 T CCH Cancel CHaracter, ignore previous character
181 225 95 U MW Message Waiting, turns on an indicator on the terminal
182 226 96 V SPA Start of Protected Area
183 227 97 W EPA End of Protected Area
184 230 98 X Reserved for for future standard
186 232 9A Z * Reserved, but causes DEC terminals to respond with DA codes
187 233 9B [ CSI * Control Sequence Introducer (described in a separate table)
188 234 9C \ ST * String Terminator (VT125 exits graphics)
189 235 9D ] OSC Operating System Command (reprograms intelligent terminal)
190 236 9E ^ PM Privacy Message (password verification), terminated by ST
191 237 9F _ APC Application Program Command (to word processor), term by ST
193 ==============================================================================
194 \f Character set selection sequences (from ANSI X3.41-1974)
195 All are 3 characters long (including the ESCape). Alphabetic characters
196 as 3rd character are defined by ANSI, parameter characters as 3rd character
197 may be interpreted differently by each terminal manufacturer.
199 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
200 --- -- -- - ------------------------------------------------------------------
201 040 20 ANNOUNCER - Determines whether to use 7-bit or 8-bit ASCII
202 A G0 only will be used. Ignore SI, SO, and G1.
203 B G0 and G1 used internally. SI and SO affect G0, G1 is ignored.
204 C G0 and G1 in an 8-bit only environment. SI and SO are ignored.
205 D G0 and G1 are used, SI and SO affect G0.
207 F * 7-bit transmission, VT240/PRO350 sends CSI as two characters ESC [
208 G * 8-bit transmission, VT240/PRO350 sends CSI as single 8-bit character
209 041 21 ! Select C0 control set (choice of 63 standard, 16 private)
210 042 22 " Select C1 control set (choice of 63 standard, 16 private)
211 043 23 # Translate next character to a special single character
212 #3 * DECDHL1 - Double height line, top half
213 #4 * DECDHL2 - Double height line, bottom half
214 #5 * DECSWL - Single width line
215 #6 * DECDWL - Double width line
216 #7 * DECHCP - Make a hardcopy of the graphics screen (GIGI,VT125,VT241)
217 #8 * DECALN - Alignment display, fill screen with "E" to adjust focus
218 044 24 $ MULTIBYTE CHARACTERS - Displayable characters require 2-bytes each
219 045 25 % SPECIAL INTERPRETATION - Such as 9-bit data
220 046 26 & Reserved for future standardization
221 047 27 ' Reserved for future standardization
222 050 28 ( * SCS - Select G0 character set (choice of 63 standard, 16 private)
223 (0 * DEC VT100 line drawing set (affects lowercase characters)
224 (1 * DEC Alternate character ROM set (RAM set on GIGI and VT220)
225 (2 * DEC Alternate character ROM set with line drawing
226 (5 * DEC Finnish on LA100
227 (6 * DEC Norwegian/Danish on LA100
228 (7 * DEC Swedish on LA100
229 (9 * DEC French Canadian
230 (< * DEC supplemental graphics (everything not in USASCII)
231 (A * UKASCII (British pound sign)
232 (B * USASCII (American pound sign)
233 (C * ISO Finnish on LA120
234 (E * ISO Norwegian/Danish on LA120
235 (H * ISO Swedish on LA120
236 (K * ISO German on LA100,LA120
237 (R * ISO French on LA100,LA120
238 (Y * ISO Italian on LA100
239 (Z * ISO Spanish on LA100
240 051 29 ) * SCS - Select G1 character set (choice of 63 standard, 16 private)
241 * (same character sets as listed under G0)
242 052 2A * * SCS - Select G2 character set
243 * (same character sets as listed under G0)
244 053 2B + * SCS - Select G3 character set
245 * (same character sets as listed under G0)
246 054 2C , SCS - Select G0 character set (additional 63+16 sets)
247 055 2D - SCS - Select G1 character set (additional 63+16 sets)
248 056 2E . SCS - Select G2 character set
249 057 2F / SCS - Select G3 character set
251 ==============================================================================
252 \f Private two-character escape sequences (allowed by ANSI X3.41-1974)
253 These can be defined differently by each terminal manufacturer.
255 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
256 --- -- - - ------------------------------------------------------------------
258 061 31 1 DECGON graphics on for VT105, DECHTS horiz tab set for LA34/LA120
259 062 32 2 DECGOFF graphics off VT105, DECCAHT clear all horz tabs LA34/LA120
260 063 33 3 DECVTS - set vertical tab for LA34/LA120
261 064 34 4 DECCAVT - clear all vertical tabs for LA34/LA120
262 065 35 5 * DECXMT - Host requests that VT132 transmit as if ENTER were pressed
264 067 37 7 * DECSC - Save cursor position and character attributes
265 070 38 8 * DECRC - Restore cursor and attributes to previously saved position
269 074 3C < * DECANSI - Switch from VT52 mode to VT100 mode
270 075 3D = * DECKPAM - Set keypad to applications mode (ESCape instead of digits)
271 076 3E > * DECKPNM - Set keypad to numeric mode (digits instead of ESCape seq)
274 DCS Device Control Strings used by DEC terminals (ends with ST)
276 Pp = Start ReGIS graphics (VT125, GIGI, VT240, PRO350)
277 Pq = Start SIXEL graphics (screen dump to LA34, LA100, screen load to VT125)
278 Pr = SET-UP data for GIGI, $PrVC0$\ disables both visible cursors.
279 Ps = Reprogram keys on the GIGI, $P0sDIR<CR>$\ makes keypad 0 send "DIR<CR>"
280 0-9=digits on keypad, 10=ENTER, 11=minus, 12=comma, 13=period,
281 14-17=PF1-PF4, 18-21=cursor keys. Enabled by $[?23h (PK1).
282 Pt = Start VT105 graphics on a VT125
284 ==============================================================================
286 Standard two-character escape sequences (defined by ANSI X3.64-1979)
288 100 40 @ See description of C1 control characters
289 An ESCape followed by one of these uppercase characters is translated
290 to an 8-bit C1 control character before being interpreted.
291 220 90 P DCS - Device Control String, terminated by ST - see table above.
292 133 5B [ CSI - Control Sequence Introducer - see table below.
293 137 5F _ See description of C1 control characters
295 ==============================================================================
297 Independent control functions (from Appendix E of X3.64-1977).
298 These four controls have the same meaning regardless of the current
299 definition of the C0 and C1 control sets. Each control is a two-character
300 ESCape sequence, the 2nd character is lowercase.
302 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
303 --- -- - - --------------------------------------------------------------------
304 140 60 ` DMI - Disable Manual Input
305 141 61 a INT - INTerrupt the terminal and do special action
306 142 62 b EMI - Enable Manual Input
307 143 63 c * RIS - Reset to Initial State (VT100 does a power-on reset)
308 ... The remaining lowercase characters are reserved by ANSI.
309 153 6B k NAPLPS lock-shift G1 to GR
310 154 6C l NAPLPS lock-shift G2 to GR
311 155 6D m NAPLPS lock-shift G3 to GR
312 156 6E n * LS2 - Shift G2 to GL (extension of SI) VT240,NAPLPS
313 157 6F o * LS3 - Shift G3 to GL (extension of SO) VT240,NAPLPS
314 ... The remaining lowercase characters are reserved by ANSI.
315 174 7C | * LS3R - VT240 lock-shift G3 to GR
316 175 7D } * LS2R - VT240 lock-shift G2 to GR
317 176 7E ~ * LS1R - VT240 lock-shift G1 to GR
319 ==============================================================================
320 \f Control Sequences (defined by ANSI X3.64-1979)
322 Control Sequences are started by either ESC [ or CSI and are terminated by an
323 "alphabetic" character (100 to 176 octal, 40 to 7E hex). Intermediate
324 characters are space through slash (40 to 57 octal, 20 to 2F hex) and parameter
325 characters are zero through question mark (60 to 77 octal, 30 to 3F hex,
326 including digits and semicolon). Parameters consist of zero or more decimal
327 numbers separated by semicolons. Leading zeros are optional, leading blanks
328 are not allowed. If no digits precede the final character, the default
329 parameter is used. Many functions treat a parameter of 0 as if it were 1.
331 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
332 --- -- - - --------------------------------------------------------------------
333 100 40 @ ICH - Insert CHaracter
334 [10@ = Make room for 10 characters at current position
335 101 41 A * CUU - CUrsor Up
336 * [A = Move up one line, stop at top of screen, [9A = move up 9
337 102 42 B * CUD - CUrsor Down
338 * [B = Move down one line, stop at bottom of screen
339 103 43 C * CUF - CUrsor Forward
340 * [C = Move forward one position, stop at right edge of screen
341 104 44 D * CUB - CUrsor Backward
342 * [D = Same as BackSpace, stop at left edge of screen
343 105 45 E CNL - Cursor to Next Line
344 [5E = Move to first position of 5th line down
345 106 46 F CPL - Cursor to Previous Line
346 [5F = Move to first position of 5th line previous
347 107 47 G CHA - Cursor Horizontal position Absolute
348 [40G = Move to column 40 of current line
349 110 48 H * CUP - CUrsor Position
350 * [H = Home, [24;80H = Row 24, Column 80
351 111 49 I CHT - Cursor Horizontal Tabulation
352 [I = Same as HT (Control-I), [3I = Go forward 3 tabs
353 112 4A J * ED - Erase in Display (cursor does not move)
354 * [J = [0J = Erase from current position to end (inclusive)
355 * [1J = Erase from beginning to current position (inclusive)
356 * [2J = Erase entire display
357 * [?0J = Selective erase in display ([?1J, [?2J similar)
358 113 4B K * EL - Erase in Line (cursor does not move)
359 * [K = [0K = Erase from current position to end (inclusive)
360 * [1K = Erase from beginning to current position
361 * [2K = Erase entire current line
362 * [?0K = Selective erase to end of line ([?1K, [?2K similar)
363 114 4C L * IL - Insert Line, current line moves down (VT102 series)
364 [3L = Insert 3 lines if currently in scrolling region
365 115 4D M * DL - Delete Line, lines below current move up (VT102 series)
366 [2M = Delete 2 lines if currently in scrolling region
367 116 4E N EF - Erase in Field (as bounded by protected fields)
368 [0N, [1N, [2N act like [L but within currend field
369 117 4F O EA - Erase in qualified Area (defined by DAQ)
370 [0O, [1O, [2O act like [J but within current area
371 120 50 P * DCH - Delete Character, from current position to end of field
372 [4P = Delete 4 characters, VT102 series
373 121 51 Q SEM - Set Editing extent Mode (limits ICH and DCH)
374 [0Q = [Q = Insert/delete character affects rest of display
375 [1Q = ICH/DCH affect the current line only
376 [2Q = ICH/DCH affect current field (between tab stops) only
377 [3Q = ICH/DCH affect qualified area (between protected fields)
378 122 52 R * CPR - Cursor Position Report (from terminal to host)
379 * [24;80R = Cursor is positioned at line 24 column 80
380 123 53 S SU - Scroll up, entire display is moved up, new lines at bottom
381 [3S = Move everything up 3 lines, bring in 3 new lines
382 124 54 T SD - Scroll down, new lines inserted at top of screen
383 [4T = Scroll down 4, bring previous lines back into view
384 125 55 U NP - Next Page (if terminal has more than 1 page of memory)
385 [2U = Scroll forward 2 pages
386 126 56 V PP - Previous Page (if terminal remembers lines scrolled off top)
387 [1V = Scroll backward 1 page
388 127 57 W CTC - Cursor Tabulation Control
389 [0W = Set horizontal tab for current line at current position
390 [1W = Set vertical tab stop for current line of current page
391 [2W = Clear horiz tab stop at current position of current line
392 [3W = Clear vert tab stop at current line of current page
393 [4W = Clear all horiz tab stops on current line only
394 [5W = Clear all horiz tab stops for the entire terminal
395 [6W = Clear all vert tabs stops for the entire terminal
396 130 58 X ECH - Erase CHaracter
397 [4X = Change next 4 characters to "erased" state
398 131 59 Y CVT - Cursor Vertical Tab
399 [2Y = Move forward to 2nd following vertical tab stop
400 132 5A Z CBT - Cursor Back Tab
401 [3Z = Move backwards to 3rd previous horizontal tab stop
402 133 5B [ Reserved for future standardization left bracket
403 134 5C \ Reserved reverse slant
404 135 5D ] Reserved right bracket
405 136 5E ^ Reserved circumflex
406 137 5F _ Reserved underscore
407 140 60 ` * HPA - Horizontal Position Absolute (depends on PUM)
408 [720` = Move to 720 decipoints (1 inch) from left margin
409 * [80` = Move to column 80 on LA120
410 141 61 a * HPR - Horizontal Position Relative (depends on PUM)
411 [360a = Move 360 decipoints (1/2 inch) from current position
412 * [40a = Move 40 columns to right of current position on LA120
413 142 62 b REP - REPeat previous displayable character
414 [80b = Repeat character 80 times
415 143 63 c * DA - Device Attributes
416 * [c = Terminal will identify itself
417 * [?1;2c = Terminal is saying it is a VT100 with AVO
418 * [>0c = Secondary DA request (distinguishes VT240 from VT220)
419 144 64 d * VPA - Vertical Position Absolute (depends on PUM)
420 [90d = Move to 90 decipoints (1/8 inch) from top margin
421 * [10d = Move to line 10 if before that else line 10 next page
422 145 65 e * VPR - Vertical Position Relative (depends on PUM)
423 [720e = Move 720 decipoints (1 inch) down from current position
424 * [6e = Advance 6 lines forward on LA120
425 146 66 f * HVP - Horizontal and Vertical Position (depends on PUM)
426 [720,1440f = Move to 1 inch down and 2 inches over (decipoints)
427 * [24;80f = Move to row 24 column 80 if PUM is set to character
428 147 67 g * TBC - Tabulation Clear
429 * [0g = Clear horizontal tab stop at current position
430 * [1g = Clear vertical tab stop at current line (LA120)
431 * [2g = Clear all horizontal tab stops on current line only LA120
432 * [3g = Clear all horizontal tab stops in the terminal
433 150 68 h * SM - Set Mode (. means permanently set on VT100)
434 [0h = Error, this command is ignored
435 * [1h = GATM - Guarded Area Transmit Mode, send all (VT132)
436 [2h = KAM - Keyboard Action Mode, disable keyboard input
437 [3h = CRM - Control Representation Mode, show all control chars
438 * [4h = IRM - Insertion/Replacement Mode, set insert mode (VT102)
439 [5h = SRTM - Status Report Transfer Mode, report after DCS
440 * [6h = ERM - ERasure Mode, erase protected and unprotected
441 [7h = VEM - Vertical Editing Mode, IL/DL affect previous lines
442 [8h, [9h are reserved
443 [10h = HEM - Horizontal Editing mode, ICH/DCH/IRM go backwards
444 [11h = PUM - Positioning Unit Mode, use decipoints for HVP/etc
445 . [12h = SRM - Send Receive Mode, transmit without local echo
446 [13h = FEAM - Format Effector Action Mode, FE's are stored
447 [14h = FETM - Format Effector Transfer Mode, send only if stored
448 [15h = MATM - Multiple Area Transfer Mode, send all areas
449 * [16h = TTM - Transmit Termination Mode, send scrolling region
450 [17h = SATM - Send Area Transmit Mode, send entire buffer
451 [18h = TSM - Tabulation Stop Mode, lines are independent
452 [19h = EBM - Editing Boundary Mode, all of memory affected
453 * [20h = LNM - Linefeed Newline Mode, LF interpreted as CR LF
454 * [?1h = DECCKM - Cursor Keys Mode, send ESC O A for cursor up
455 * [?2h = DECANM - ANSI Mode, use ESC < to switch VT52 to ANSI
456 * [?3h = DECCOLM - COLumn mode, 132 characters per line
457 * [?4h = DECSCLM - SCrolL Mode, smooth scrolling
458 * [?5h = DECSCNM - SCreeN Mode, black on white background
459 * [?6h = DECOM - Origin Mode, line 1 is relative to scroll region
460 * [?7h = DECAWM - AutoWrap Mode, start newline after column 80
461 * [?8h = DECARM - Auto Repeat Mode, key will autorepeat
462 * [?9h = DECINLM - INterLace Mode, interlaced for taking photos
463 * [?10h = DECEDM - EDit Mode, VT132 is in EDIT mode
464 * [?11h = DECLTM - Line Transmit Mode, ignore TTM, send line
466 * [?13h = DECSCFDM - Space Compression/Field Delimiting on,
467 * [?14h = DECTEM - Transmit Execution Mode, transmit on ENTER
469 * [?16h = DECEKEM - Edit Key Execution Mode, EDIT key is local
471 * [?18h = DECPFF - Print FormFeed mode, send FF after printscreen
472 * [?19h = DECPEXT - Print Extent mode, print entire screen
473 * [?20h = OV1 - Overstrike, overlay characters on GIGI
474 * [?21h = BA1 - Local BASIC, GIGI to keyboard and screen
475 * [?22h = BA2 - Host BASIC, GIGI to host computer
476 * [?23h = PK1 - GIGI numeric keypad sends reprogrammable sequences
477 * [?24h = AH1 - Autohardcopy before erasing or rolling GIGI screen
478 * [?29h = - Use only the proper pitch for the LA100 font
479 * [?38h = DECTEK - TEKtronix mode graphics
480 151 69 i * MC - Media Copy (printer port on VT102)
481 * [0i = Send contents of text screen to printer
482 [1i = Fill screen from auxiliary input (printer's keyboard)
483 [2i = Send screen to secondary output device
484 [3i = Fill screen from secondary input device
485 * [4i = Turn on copying received data to primary output (VT125)
486 * [4i = Received data goes to VT102 screen, not to its printer
487 * [5i = Turn off copying received data to primary output (VT125)
488 * [5i = Received data goes to VT102's printer, not its screen
489 * [6i = Turn off copying received data to secondary output (VT125)
490 * [7i = Turn on copying received data to secondary output (VT125)
491 * [?0i = Graphics screen dump goes to graphics printer VT125,VT240
492 * [?1i = Print cursor line, terminated by CR LF
493 * [?2i = Graphics screen dump goes to host computer VT125,VT240
494 * [?4i = Disable auto print
495 * [?5i = Auto print, send a line at a time when linefeed received
496 152 6A j Reserved for future standardization
497 153 6B k Reserved for future standardization
498 154 6C l * RM - Reset Mode (. means permanently reset on VT100)
499 * [1l = GATM - Transmit only unprotected characters (VT132)
500 . [2l = KAM - Enable input from keyboard
501 . [3l = CRM - Control characters are not displayable characters
502 * [4l = IRM - Reset to replacement mode (VT102)
503 . [5l = SRTM - Report only on command (DSR)
504 * [6l = ERM - Erase only unprotected fields
505 . [7l = VEM - IL/DL affect lines after current line
506 [8l, [9l are reserved
507 . [10l = HEM - ICH and IRM shove characters forward, DCH pulls
508 . [11l = PUM - Use character positions for HPA/HPR/VPA/VPR/HVP
509 [12l = SRM - Local echo - input from keyboard sent to screen
510 . [13l = FEAM - HPA/VPA/SGR/etc are acted upon when received
511 . [14l = FETM - Format Effectors are sent to the printer
512 [15l = MATM - Send only current area if SATM is reset
513 * [16l = TTM - Transmit partial page, up to cursor position
514 [17l = SATM - Transmit areas bounded by SSA/ESA/DAQ
515 . [18l = TSM - Setting a tab stop on one line affects all lines
516 . [19l = EBM - Insert does not overflow to next page
517 * [20l = LNM - Linefeed does not change horizontal position
518 * [?1l = DECCKM - Cursor keys send ANSI cursor position commands
519 * [?2l = DECANM - Use VT52 emulation instead of ANSI mode
520 * [?3l = DECCOLM - 80 characters per line (erases screen)
521 * [?4l = DECSCLM - Jump scrolling
522 * [?5l = DECSCNM - Normal screen (white on black background)
523 * [?6l = DECOM - Line numbers are independent of scrolling region
524 * [?7l = DECAWM - Cursor remains at end of line after column 80
525 * [?8l = DECARM - Keys do not repeat when held down
526 * [?9l = DECINLM - Display is not interlaced to avoid flicker
527 * [?10l = DECEDM - VT132 transmits all key presses
528 * [?11l = DECLTM - Send page or partial page depending on TTM
530 * [?13l = DECSCFDM - Don't suppress trailing spaces on transmit
531 * [?14l = DECTEM - ENTER sends ESC S (STS) a request to send
533 * [?16l = DECEKEM - EDIT key transmits either $[10h or $[10l
535 * [?18l = DECPFF - Don't send a formfeed after printing screen
536 * [?19l = DECPEXT - Print only the lines within the scroll region
537 * [?20l = OV0 - Space is destructive, replace not overstrike, GIGI
538 * [?21l = BA0 - No BASIC, GIGI is On-Line or Local
539 * [?22l = BA0 - No BASIC, GIGI is On-Line or Local
540 * [?23l = PK0 - Ignore reprogramming on GIGI keypad and cursors
541 * [?24l = AH0 - No auto-hardcopy when GIGI screen erased
542 * [?29l = Allow all character pitches on the LA100
543 * [?38l = DECTEK - Ignore TEKtronix graphics commands
544 155 6D m * SGR - Set Graphics Rendition (affects character attributes)
545 * [0m = Clear all special attributes
546 * [1m = Bold or increased intensity
547 * [2m = Dim or secondary color on GIGI (superscript on XXXXXX)
548 [3m = Italic (subscript on XXXXXX)
549 * [4m = Underscore, [0;4m = Clear, then set underline only
551 [6m = Fast blink (overscore on XXXXXX)
552 * [7m = Negative image, [0;1;7m = Bold + Inverse
553 [8m = Concealed (do not display character echoed locally)
554 [9m = Reserved for future standardization
555 * [10m = Select primary font (LA100)
556 * [11m - [19m = Selete alternate font (LA100 has 11 thru 14)
557 [20m = FRAKTUR (whatever that means)
558 * [22m = Cancel bold or dim attribute only (VT220)
559 * [24m = Cancel underline attribute only (VT220)
560 * [25m = Cancel fast or slow blink attribute only (VT220)
561 * [27m = Cancel negative image attribute only (VT220)
562 * [30m = Write with black, [40m = Set background to black (GIGI)
563 * [31m = Write with red, [41m = Set background to red
564 * [32m = Write with green, [42m = Set background to green
565 * [33m = Write with yellow, [43m = Set background to yellow
566 * [34m = Write with blue, [44m = Set background to blue
567 * [35m = Write with magenta, [45m = Set background to magenta
568 * [36m = Write with cyan, [46m = Set background to cyan
569 * [37m = Write with white, [47m = Set background to white
570 [38m, [39m, [48m, [49m are reserved
571 156 6E n * DSR - Device Status Report
572 * [0n = Terminal is ready, no malfunctions detected
573 [1n = Terminal is busy, retry later
574 [2n = Terminal is busy, it will send DSR when ready
575 * [3n = Malfunction, please try again
576 [4n = Malfunction, terminal will send DSR when ready
577 * [5n = Command to terminal to report its status
578 * [6n = Command to terminal requesting cursor position (CPR)
579 * [?15n = Command to terminal requesting printer status, returns
580 [?10n = OK, [?11n = not OK, [?13n = no printer.
581 * [?25n = "Are User Defined Keys Locked?" (VT220)
582 157 6F o DAQ - Define Area Qualification starting at current position
583 [0o = Accept all input, transmit on request
584 [1o = Protected and guarded, accept no input, do not transmit
585 [2o = Accept any printing character in this field
586 [3o = Numeric only field
587 [4o = Alphabetic (A-Z and a-z) only
588 [5o = Right justify in area
589 [3;6o = Zero fill in area
590 [7o = Set horizontal tab stop, this is the start of the field
591 [8o = Protected and unguarded, accept no input, do transmit
592 [9o = Space fill in area
594 ==============================================================================
596 Private Control Sequences (allowed by ANSI X3.41-1974).
597 These take parameter strings and terminate with the last half of lowercase.
599 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
600 --- -- - - --------------------------------------------------------------------
601 160 70 p * DECSTR - Soft Terminal Reset
602 [!p = Soft Terminal Reset
603 161 71 q * DECLL - Load LEDs
604 [0q = Turn off all, [?1;4q turns on L1 and L4, etc
605 [154;155;157q = VT100 goes bonkers
606 [2;23!q = Partial screen dump from GIGI to graphics printer
607 [0"q = DECSCA Select Character Attributes off
608 [1"q = DECSCA - designate set as non-erasable
609 [2"q = DECSCA - designate set as erasable
610 162 72 r * DECSTBM - Set top and bottom margins (scroll region on VT100)
611 [4;20r = Set top margin at line 4 and bottom at line 20
612 163 73 s * DECSTRM - Set left and right margins on LA100,LA120
613 [5;130s = Set left margin at column 5 and right at column 130
614 164 74 t * DECSLPP - Set physical lines per page
615 [66t = Paper has 66 lines (11 inches at 6 per inch)
616 165 75 u * DECSHTS - Set many horizontal tab stops at once on LA100
617 [9;17;25;33;41;49;57;65;73;81u = Set standard tab stops
618 166 76 v * DECSVTS - Set many vertical tab stops at once on LA100
619 [1;16;31;45v = Set vert tabs every 15 lines
620 167 77 w * DECSHORP - Set horizontal pitch on LAxxx printers
621 [1w = 10 characters per inch, [2w = 12 characters per inch
622 [0w=10, [3w=13.2, [4w=16.5, [5w=5, [6w=6, [7w=6.6, [8w=8.25
623 170 78 x * DECREQTPARM - Request terminal parameters
624 [3;5;2;64;64;1;0x = Report, 7 bit Even, 1200 baud, 1200 baud
625 171 79 y * DECTST - Invoke confidence test
626 [2;1y = Power-up test on VT100 series (and VT100 part of VT125)
627 [3;1y = Power-up test on GIGI (VK100)
628 [4;1y = Power-up test on graphics portion of VT125
629 172 7A z * DECVERP - Set vertical pitch on LA100
630 [1z = 6 lines per inch, [2z = 8 lines per inch
631 [0z=6, [3z=12, [4z=3, [5z=3, [6z=4
633 174 7C | * DECTTC - Transmit Termination Character
634 [0| = No extra characters, [1| = terminate with FF
635 175 7D } * DECPRO - Define protected field on VT132
636 [0} = No protection, [1;4;5;7} = Any attribute is protected
637 [254} = Characters with no attributes are protected
638 176 7E ~ * DECKEYS - Sent by special function keys
639 [1~=FIND, [2~=INSERT, [3~=REMOVE, [4~=SELECT, [5~=PREV, [6~=NEXT
640 [17~=F6...[34~=F20 ([23~=ESC,[24~=BS,[25~=LF,[28~=HELP,[29~=DO)
641 177 7F DELETE is always ignored
643 ==============================================================================
644 \f Control Sequences with intermediate characters (from ANSI X3.64-1979).
645 Note that there is a SPACE character before the terminating alphabetic.
647 Oct Hex * (* marks function used in DEC VT series or LA series terminals)
648 --- -- - - --------------------------------------------------------------------
649 100 40 @ SL - Scroll Left
650 [4 @ = Move everything over 4 columns, 4 new columns at right
651 101 41 A SR - Scroll Right
652 [2 A = Move everything over 2 columns, 2 new columns at left
653 102 42 B GSM - Graphic Size Modification
654 [110;50 B = Make 110% high, 50% wide
655 103 43 C GSS - Graphic Size Selection
656 [120 C = Make characters 120 decipoints (1/6 inch) high
657 104 44 D FNT - FoNT selection (used by SGR, [10m thru [19m)
658 [0;23 D = Make primary font be registered font #23
659 105 45 E TSS - Thin Space Specification
660 [36 E = Define a thin space to be 36 decipoints (1/20 inch)
661 106 46 F JFY - JustiFY, done by the terminal/printer
662 [0 E = No justification
663 [1 E = Fill, bringing words up from next line if necessary
664 [2 E = Interword spacing, adjust spaces between words
665 [3 E = Letter spacing, adjust width of each letter
666 [4 E = Use hyphenation
667 [5 E = Flush left margin
668 [6 E = Center following text between margins (until [0 E)
669 [7 E = Flush right margin
670 [8 E = Italian form (underscore instead of hyphen)
671 107 47 G SPI - SPacing Increment (in decipoints)
672 [120;72 G = 6 per inch vertical, 10 per inch horizontal
673 110 48 H QUAD- Do quadding on current line of text (typography)
674 [0 H = Flush left, [1 H = Flush left and fill with leader
675 [2 H = Center, [3 H = Center and fill with leader
676 [4 H = Flush right, [5 H = Flush right and fill with leader
677 111 49 I Reserved for future standardization
678 157 67 o Reserved for future standardization
680 ... May be defined by the printer manufacturer
682 177 7F DELETE is always ignored
684 ==============================================================================
685 \fMinimum requirements for VT100 emulation:
687 1) To act as a passive display, implement the 4 cursor commands, the 2 erase
688 commands, direct cursor addressing, and at least inverse characters.
689 The software should be capable of handling strings with 16 numeric parameters
690 with values in the range of 0 to 255.
692 [A Move cursor up one row, stop if a top of screen
693 [B Move cursor down one row, stop if at bottom of screen
694 [C Move cursor forward one column, stop if at right edge of screen
695 [D Move cursor backward one column, stop if at left edge of screen
696 [H Home to row 1 column 1 (also [1;1H)
697 [J Clear from current position to bottom of screen
698 [K Clear from current position to end of line
699 [24;80H Position to line 24 column 80 (any line 1 to 24, any column 1 to 132)
700 [0m Clear attributes to normal characters
701 [7m Add the inverse video attribute to succeeding characters
702 [0;7m Set character attributes to inverse video only
704 2) To enter data in VT100 mode, implement the 4 cursor keys and the 4 PF keys.
705 It must be possible to enter ESC, TAB, BS, DEL, and LF from the keyboard.
707 [A Sent by the up-cursor key (alternately ESC O A)
708 [B Sent by the down-cursor key (alternately ESC O B)
709 [C Sent by the right-cursor key (alternately ESC O C)
710 [D Sent by the left-cursor key (alternately ESC O D)
711 OP PF1 key sends ESC O P
712 OQ PF2 key sends ESC O Q
713 OR PF3 key sends ESC O R
714 OS PF3 key sends ESC O S
715 [c Request for the terminal to identify itself
716 [?1;0c VT100 with memory for 24 by 80, inverse video character attribute
717 [?1;2c VT100 capable of 132 column mode, with bold+blink+underline+inverse
719 3) When doing full-screen editing on a VT100, implement directed erase, the
720 numeric keypad in applications mode, and the limited scrolling region.
721 The latter is needed to do insert/delete line functions without rewriting
724 [0J Erase from current position to bottom of screen inclusive
725 [1J Erase from top of screen to current position inclusive
726 [2J Erase entire screen (without moving the cursor)
727 [0K Erase from current position to end of line inclusive
728 [1K Erase from beginning of line to current position inclusive
729 [2K Erase entire line (without moving cursor)
730 [12;24r Set scrolling region to lines 12 thru 24. If a linefeed or an
731 INDex is received while on line 24, the former line 12 is deleted
732 and rows 13-24 move up. If a RI (reverse Index) is received while
733 on line 12, a blank line is inserted there as rows 12-13 move down.
734 All VT100 compatible terminals (except GIGI) have this feature.
735 ESC = Set numeric keypad to applications mode
736 ESC > Set numeric keypad to numbers mode
737 OA Up-cursor key sends ESC O A after ESC = ESC [ ? 1 h
738 OB Down-cursor key sends ESC O B " " "
739 OC Right-cursor key sends ESC O B " " "
740 OB Left-cursor key sends ESC O B " " "
741 OM ENTER key sends ESC O M after ESC =
742 Ol COMMA on keypad sends ESC O l " " (that's lowercase L)
743 Om MINUS on keypad sends ESC O m " "
744 Op ZERO on keypad sends ESC O p " "
745 Oq ONE on keypad sends ESC O q " "
746 Or TWO on keypad sends ESC O r " "
747 Os THREE on keypad sends ESC O s " "
748 Ot FOUR on keypad sends ESC O t " "
749 Ou FIVE on keypad sends ESC O u " "
750 Ov SIX on keypad sends ESC O v " "
751 Ow SEVEN on keypad sends ESC O w " "
752 Ox EIGHT on keypad sends ESC O x " "
753 Oy NINE on keypad sends ESC O y " "
755 4) If the hardware is capable of double width/double height:
757 #3 Top half of a double-width double-height line
758 #4 Bottom half of a double-width double-height line
759 #5 Make line single-width (lines are set this way when cleared by ESC [ J)
760 #6 Make line double-width normal height (40 or 66 characters)
762 5) If the terminal emulator is capable of insert/delete characters,
763 insert/delete lines, insert/replace mode, and can do a full-screen dump to
764 the printer (in text mode), then it should identify itself as a VT102
766 [c Request for the terminal to identify itself
767 [?6c VT102 (printer port, 132 column mode, and ins/del standard)
768 [1@ Insert a blank character position (shift line to the right)
769 [1P Delete a character position (shift line to the left)
770 [1L Insert blank line at current row (shift screen down)
771 [1M Delete the current line (shift screen up)
772 [4h Set insert mode, new characters shove existing ones to the right
773 [4l Reset insert mode, new characters replace existing ones
774 [0i Print screen (all 24 lines) to the printer
775 [4i All received data goes to the printer (nothing to the screen)
776 [5i All received data goes to the screen (nothing to the printer)
779 [End of ANSICODE.TXT]