Professional Documents
Culture Documents
These sequences are usually implemented in the terminal emulator in the system's BIOS (?) and are available in DOS, linux console and windows
command modes.
In *nix systems, termcap, terminfo and curses are involved in displaying character sequences.
It may be helpful to create a file containing only the ESCape character by:
echo ‐n $'\e' > ESC
The VT100 USER GUIDE and ANSI standard X3.641979 both list the ANSI ESCape sequences in alphabetic order by mnemonic, but do not have a have
a cross reference in order by ASCII code. This document lists the combination of all definitions from the three ANSI standards in numeric order. For a
description of the advantages of using these standards, see the article "Toward Standardized Video Terminals" in the April1984 issue of BYTE magazine.
ANSI X3.411974 introduces an 8bit ASCII character set (C1 and G1 in addition to the existing C0 and G0). It describes how to use the 8bit features in
a 7bit environment. X3.41 defines the format of all ESCape sequences, but defines only the 3character ones with a parameter character in the middle.
These instruct the terminal how to interpret the C0, G0, C1, and G1 characters (such as by selecting different characterset ROMs).
Note: NAPLPS does videotex graphics by redefining the C1 set and selecting alternate G0, G1, G2, and G3 sets. See the February 1983 issue of BYTE
magazine for details.
ANSI X3.41977 defines the 7bit ASCII character set (C0 and G0). It was written in 1968, revised in 1977, and explains the decisions made in laying out
the ASCII code. In particular, it explains why ANSI chose to make ASCII incompatible with EBCDIC in order to make it selfconsistant.
ANSI X3.641979 defines the remaining ESCape sequences. It defines all the C1 control characters, and specifies that certain twocharacter ESCape
sequences in the 7bit environment are to act exactly like the 8bit C1 control set. X3.64 introduces a ControlSequence, which starts with CSI character,
has an indefinite length, and is terminated by an alphabetic character. The VT100 was one of the first terminals to implement this standard.
Definitions:
Control Character A single character with an ASCII code within the ranges: 000 to 037 and 200 to 237 octal, 00 1F and 80 9F hex.
Escape Sequence
2 or 3 character string staring with ␛ (Four or more character strings are allowed but not defined.)
Control Sequence
A string starting with CSI (233 octal, 9B hex) or with ␛ [ (LeftBracket) and terminated by an alphabetic character.
Any number of parameter characters (digits 0 to 9, semicolon, and question mark) may appear within the Control
Sequence.
The terminating character may be preceded by an intermediate character (such as space).
£
Character classifications :
octal Hex
C0 Control 000037 001F (G0 is 041176 octal, 217E hex)
SPACE 040+240 20+A0 Always and everywhere a blank space
Intermediate 040057 202F !"#$%&'()*+,‐./
Parameters 060077 303F 0123456789:;<=>
Uppercase 100137 405F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
Lowercas 140176 607E `abcdefghijlkmnopqrstuvwxyz{|}~
Alphabetic 100176 407E (all of upper and lower case)
Delete 177 7F Always and everywhere ignored
C1 Control 809F
␛
200237
Note that in this document, the terms uppercase, lowercase, and alphabetics include more characters than just A to Z.
The length of the ESCape Sequence depends on the character that immediately follows the ␛.
CSI is the twocharacter sequence ESC[ or the 8bit C1 code of 233 octal, 9B hex.
CSI introduces a Control Sequence, which continues until an alphabetic character is received.
General rules for a Control Sequence:
control t
e
x
Oct Hex t Name * * marks function used in DEC VT series or LA series terminals)
200 80 @ Reserved for future standardization
201 81 A Reserved
202 82 B Reserved
203 83 C Reserved
£
ESC]0;stringBEL Set icon name and window title to string
ESC]1;stringBEL Set icon name to string
ESC]2;stringBEL Set window title to string
t
e
x
Oct Hex t example x'1B2330' ESC #3 set DoubleHeight top half (send bottom half next)
040 20 ANNOUNCER Determines whether to use 7bit or 8bit ASCII
A G0 only will be used. Ignore SI, SO, and G1. (Graphic characters)
B G0 and G1 used internally. SI and SO affect G0, Ignore G1
C G0 and G1 in an 8bit only environment. Ignore SI and SO
D G0 and G1 are used, SI and SO affect G0.
E
F * 7bit transmission, VT240/PRO350 sends CSI as two characters ESC [
G * 8bit transmission, VT240/PRO350 sends CSI as single 8bit character
L ANSI conformance level 1
M 2 dpANS x3.134.1
N 3
041 21 ! Select C0 control set (choice of 63 standard, 16 private)
042 22 " Select C1 control set (choice of 63 standard, 16 private)
abcdefg
echo $'\e'#5bcdefg;
echo $'\e'#6bcdefg;
abcdefg
▒␉␌␍␊°±␋┘┐┌└╋‐_‐_‐_┣┫┻┳
ABCDEFGHIJKLMNOPQRSTUVWXYZ0
Linux
( B Select default (ISO 88591 mapping)
( 0 Select VT100 graphics mapping
( U Select null mapping straight to character ROM
( K Select user mapping the map that is loaded by the utility mapscrn(8).
Private twocharacter escape sequences (allowed by ANSI X3.411974) These can be defined differently by each terminal manufacturer.
Oct Hex
‐‐‐
060 30 0
061 31 1 DECGON graphics on VT105, DECHTS horiz tab set for LA34/LA120
062 32 2 DECGOFF graphics off VT105, DECCAHT clear all horz tabs LA34/LA120
063 33 3 DECVTS set vertical tab for LA34/LA120
064 34 4 DECCAVT clear all vertical tabs for LA34/LA120
065 35 5 * DECXMT Host requests that VT132 transmit as if ENTER were pressed
066 36 6 DECBI back index
067 37 7 * DECSC Save cursor position and character attributes
070 38 8 * DECRC Restore cursor and attributes to previously saved position
071 39 9 DECFI forwared index
072 3A :
073 3B ;
074 3C < * DECANSI Switch from VT52 mode to VT100 mode
075 3D = * DECKPAM Set keypad to applications mode (ESCape instead of digits)
076 3E > * DECKPNM Set keypad to numeric mode (digits intead of ESCape seq)
077 3F ?
DCS Device Control Strings used by DEC terminals (ends with ST)
Pp Start ReGIS graphics (VT125, GIGI, VT240, PRO350)
Pq Start SIXEL graphics (screen dump to LA34, LA100, screen load to VT125)
Pr SETUP data for GIGI, $PrVC0$\ disables both visible cursors.
Ps Reprogram keys on the GIGI, $P0sDIR<<CR>$\ makes keypad 0 send "DIR<CR>"
09=digits on keypad, 10=ENTER, 11=minus, 12=comma, 13=period,
1417=PF1PF4, 1821=cursor keys. Enabled by $[?23h (PK1).
Pt Start VT105 graphics on a VT125
Started by ESC[ (CSI, 1B 5B) and terminated by an alphabetic character (100 to 176 octal, 40 to 7E hex).
Intermediate characters are space through / (40 to 57 octal, 20 to 2F hex)
Parameter characters are 0 ? (60 to 77 octal, 30 to 3F hex, including digits and semicolon).
Parameters consist of zero or more decimal numbers separated by semicolons.
Leading zeros are optional, leading blanks are not allowed.
If no digits precede the final character, the default parameter is used.
Many functions treat a parameter of 0 as if it were 1.
*nix shell command: echo $'\e' can be used as the ESC leadin required by many ANSI terminal control
>
Oct Hex
100 40 @ ICH Insert CHaracter [10@ Make room for 10 characters at current position
101 41 A CUU CUrsor Up * £ [A move up one line, stop at top of screen, [9A = move up 9
102 42 B CUD CUrsor Down * £ [B move down one line, stop at bottom of screen
103 43 C CUF CUrsor Forward * £ [C move forward one position, stop at right edge of screen
104 44 D CUB CUrsor Backward * £ [D Same as BackSpace, stop at left edge of screen
105 45 E CNL Cursor to Next Line £ [5E move to first position of 5th line down
106 46 F CPL Cursor to Previous Line £ [5F move to first position of 5th line previous
107 47 G CHA Cursor Horizontal position Absolute £ [40G move to column 40 of current line
110 48 H CUP CUrsor Position * £ [H Home, [24;80H = Row 24, Column 80
111 49 I CHT Cursor Horizontal Tabulation [I as HT (ControlI)not linux, [3I = Go forward 3 tabs
112 4A J ED erase in Display (cursor does not move)* £ [J [0J = erase from current position to end (inclusive)
[1J erase from beginning to current position (inclusive)
[2J erase entire display
[3J ~erase whole display including scrollback buffer(Linux)
[?0J Selective erase in display ([?1J, [?2J similar)
113 4B K EL ‐ erase in Line (cursor does not move ) * £
[K [0K = erase from current position to end (inclusive)
[1K erase from beginning to current position
[2K erase entire current line
[?0K Selective erase to end of line ([?1K, [?2K similar)
114 4C L * IL Insert Line, current line move s down (VT102 series)£ [3L Insert 3 lines if currently in scrolling region
115 4D M * DL Delete Line, lines below current move up (VT102 series)£ [2M Delete 2 lines if currently in scrolling region
116 4E N EF erase in Field [0N, [1N, [2N act like [L but within currend field
(as bounded by protected fields)
117 4F O EA erase in qualified Area (defined by DAQ) [0O, [1O, [2O act like [J but within current area
120 50 P * DCH Delete Character, from current position to end of field [4P Delete 4 characters, VT102 series
121 51 Q SEM Set Editing extent Mode (limits ICH & DCH) [0Q [Q = Insert/delete character affects rest of display
[1Q ICH/DCH affect the current line only
[2Q ICH/DCH affect current field (between tab stops) only
[3Q ICH/DCH affect qualified area (between protected fields)
122 52 R * CPR Cursor Position Report (from terminal to host) * [24;80R Cursor is positioned at line 24 column 80
123 53 S SU Scroll up, [3S move everything up 3 lines, bring in 3 new lines
entire display is move d up, new lines at bottom
124 54 T SD Scroll down, [4T Scroll down 4, bring previous lines back into view
new lines inserted at top of screen
125 55 U NP Next Page [2U Scroll forward 2 pages
(if terminal has more than 1 page of memory)
126 56 V PP Previous Page [1V Scroll backward 1 page
(if terminal remembers lines scrolled off top)
127 57 W CTC Cursor Tabulation Control [0W Set horizontal tab for current line at current position
[1W Set vertical tab stop for current line of current page
[2W Clear horiz tab stop at current position of current line
[3W Clear vert tab stop at current line of current page
[4W Clear all horiz tab stops on current line only
[5W Clear all horiz tab stops for the entire terminal
[6W Clear all vert tabs stops for the entire terminal
130 58 X ECH erase CHaracter [4X Change next 4 characters to "erased" state
131 59 Y CVT Cursor Vertical Tab [2Y move forward to 2nd following vertical tab stop
132 5A Z CBT Cursor Back Tab [3Z move backwards to 3rd previous horizontal tab stop
133 5B [ Reserved for future standardization
134 5C \ Reserved
134 5C \ Reserved
135 5D ] Reserved
136 5E ^ Reserved
137 5F _ Reserved
140 60 ` * HPA Horizontal Position Absolute (depends on PUM) [720` move to 720 decipoints (1 inch) from left margin
[80` move to column 80 on LA120
141 61 a * HPR Horizontal Position Relative(depends on PUM) [360a move 360 decipoints (1/2 inch) from current position
[40a move 40 columns to right of current position on LA120
142 62 b REP REPeat previous displayable character [80b Repeat character 80 times
144 64 d * VPA Vertical Position Absolute(depends on PUM) [90d move to 90 decipoints (1/8 inch) from top margin
[10d move to line 10 if before that else line 10 next page
145 65 e * VPR Vertical Position Relative(depends on PUM) [720e move 720 decipoints (1 inch) down from current position
[6e Advance 6 lines forward on LA120
146 66 f * HVP Horizontal and Vertical Position(depends on PUM) [720,1440f move to 1 inch down and 2 inches over (decipoints)
[24;80f move to row 24 column 80 if PUM is set to character
147 67 g * TBC ‐ Tabulation Clear [0g Clear horizontal tab stop at current position
[1g Clear vertical tab stop at current line (LA120)
[2g Clear all horizontal tab stops on current line only LA120
[3g Clear all horizontal tab stops in the terminal
[?1h DECCKM Cursor Keys Mode, send ESC O A for cursor up [?1i Cursor keys send ANSI cursor position commands DECCKM
[?2h DECANM ANSI Mode, use ESC < to switch VT52 to ANSI [?2i Use VT52 emulation instead of ANSI mode DECANM
[?3h DECCOLM COLumn mode, 132 characters per line [?3i 80 characters per line (erases screen) DECCOLM
[?4h DECSCLM SCrolL Mode, smooth scrolling [?4i Jump scrolling DECSCLM
[?5h DECSCNM SCreeN Mode, white on black background [?5i black on white background) DEC SCNM
[?6h DECOM Origin Mode, line 1 is relative to scroll region [?6i Line numbers are independent of scrolling region DECOM
[?7h DECAWM AutoWrap Mode, start newline after column 80 [?7i Cursor remains at end of line after column 80 DECAWM
[?8h DECARM Auto Repeat Mode, key will autorepeat [?8i Keys do not repeat when held down DECARM
[?9h DECINLM INterLace Mode, interlaced for taking photos [?9i Display is not interlaced to avoid flicker DECINLM
[?10h DECEDM EDit Mode, VT132 is in EDIT mode [?10i VT132 transmits all key presses DECEDM
[?11h DECLTM Line Transmit Mode, ignore TTM, send line [?11i Send page or partial page depending on TTM DECLTM
[?12h ? [?12i
[?13h DECSCFDM Space Compression/Field Delimiting on, [?13i Don't suppress trailing spaces on transmit DECSCFDN
[?14h DECTEM Transmit Execution Mode, transmit on ENTER [?14i ENTER sends ESC S (STS) a request to send DECTEM
[?15h ? [?15i
[?16h DECEKEM Edit Key Execution Mode, EDIT key is local [?16i EDIT key transmits either $[10h or $[10l DECEKEM
[?17h ? [?17i
[?18h DECPFF Print FormFeed mode, send FF after printscreen [?18i Don't send a formfeed after printing screen DECPFF
[?19h DECPEXT Print Extent mode, print entire screen [?19i Print only the lines within the scroll region DECPEXT
[?20h OV1 Overstrike, overlay characters on GIGI [?20i OV0 Space is destructive, replace not overstrike, GIGI OV0
[?21h BA1 Local BASIC, GIGI to keyboard and screen [?21i BA0 No BASIC, GIGI is OnLine or Local BA0
[?22h BA2 Host BASIC, GIGI to host computer [?22i BA0 No BASIC, GIGI is OnLine or Local BA0
[?23h PK1 GIGI numeric keypad sends reprogrammable sequences [?23i PK0 Ignore reprogramming on GIGI keypad and curso PK0rs
[?24h AH1 Autohardcopy before erasing or rolling GIGI screen [?24i AH0 No autohardcopy when GIGI screen erased AH0
[?25h ??? show cursor [?25i ??? hide cursor
[?29h‐ Use only the proper pitch for the LA100 font [?29i Allow all character pitches on the LA100
[?38h DECTEK TEKtronix mode graphics [?38i Ignore TEKtronix graphics commands
Change a section of outout(from log to end of line) to bold: |sed unbuffered "s/log/&$\x1b[1m/; s/$/'\x1b[0m/"
see vim.wikia.com/wiki/Configuring_the_cursor
. don't omit space
[0 q blinking block
[1 q blinking block
[2 q solid block
[3 q blinking underscore
[4 q solid underscore
[5 q blinking vertile
[6 q solid verticle
162 72 r DECSTBM top and bottom margins (scroll region on VT100) [4;20r top margin at line 4 and bottom at line 20
163 73 s DECSTRM left and right margins on LA100,LA120 [5;130s left margin at column 5 and right at column 130
164 74 t DECSLPP physical lines per page [66t Paper has 66 lines (11 inches at 6 per inch)
mac book pro: font:Andale mono 14: max width is width of screen i.e. 158.
mac os keysrokes:
Increase font size: ⌘+ When the window reaches the screen size, reduces columns
Reduce font size ⌘ which permits more rows and columns.
Restore ⌘0 but does NOT restore columns!
165 75 u DECSHTS many horizontal tab stops at once on LA100 [9;17;25;33;41;49;57;65;73;81u standard tab stops
166 76 v DECSVTS many vertical tab stops at once on LA100 [1;16;31;45v vert tabs every 15 lines
167 77 w DECSHORP horizontal pitch on LAxxx printers [1w 10 characters per inch, [2w = 12 characters per inch
[0w=10, [3w=13.2, [4w=16.5, [5w=5, [6w=6, [7w=6.6, [8w=8.25
170 78 x DECREQTPARM Request terminal parameters [3;5;2;64;64;1;0x Report, 7 bit Even, 1200 baud, 1200 baud
171 79 y DECTST Invoke confidence test [2;1y Powerup test on VT100 series (and VT100 part of VT125)
[3;1y Powerup test on GIGI (VK100)
[4;1y Powerup test on graphics portion of VT125
172 7A z DECVERP Set vertical pitch on LA100 [1z 6 lines per inch, [2z = 8 lines per inch
[0z=6, [3z=12, [4z=3, [5z=3, [6z=4
173 7B { Private
174 7C | DECTTC Transmit Termination Character [0| No extra characters, [1| = terminate with FF
175 7D } DECPRO Define protected field on VT132 [0} No protection, [1;4;5;7} = Any attribute is protected
[254} Characters with no attributes are protected
176 7E ~ DECKEYS Sent by special function keys [1~=FIND, [2~=INSERT, [3~=REmove, [4~=SELECT, [5~=PREV, [6~=NEXT
[11~=F1… [17~=F6…[34~=F20 ([23~=ESC,[24~=BS,[25~=LF,[28~=HELP,[29~=DO)
177 7F DELETE is always ignored
1. To act as a passive display, implement the 4 cursor commands, the 2 erase commands, direct cursor addressing, and at least inverse
characters.
The software should be capable of handling strings with 16 numeric parameters with values in the range of 0 to 255.
2. To enter data in VT100 mode, implement the 4 cursor keys and the 4 PF keys.
It must be possible to enter ESC, TAB, BS, DEL, and LF from the keyboard.
[A Sent by the upcursor key (alternately ESC O A)
[B Sent by the downcursor key (alternately ESC O B)
[C Sent by the rightcursor key (alternately ESC O C)
[D Sent by the leftcursor key (alternately ESC O D)
OP PF1 key sends ESC O P
OQ PF2 key sends ESC O Q
OR PF3 key sends ESC O R
OS PF3 key sends ESC O S
[c Request for the terminal to identify itself
[?1;0c VT100 with memory for 24 by 80, inverse video character attribute
[?1;2c VT100 capable of 132 column mode, with bold+blink+underline+inverse
3. When doing fullscreen editing on a VT100, implement directed erase, the numeric keypad in applications mode, and
the limited scrolling region.
The latter is needed to do insert/delete line functions without rewriting the screen.
[0J erase from current position to bottom of screen inclusive
[1J erase from top of screen to current position inclusive
[2J erase entire screen (without moving the cursor)
[0K erase from current position to end of line inclusive
[1K erase from beginning of line to current position inclusive
[2K erase entire line (without moving cursor)
5. If the terminal emulator is capable of insert/delete characters, insert/delete lines, insert/replace mode, and
can do a fullscreen dump to the printer (in text mode), then it should identify itself as a VT102
This web page hand crafted by Dennis German This page last modified on 09/10/2021 04:47:35
webmaster ©2021 RealWorldSystems, All rights reserved.