ansicode.txt 41 KB

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