blob: 02a9fe51f66bc7753d75501087d97a638c32e310 [file] [log] [blame]
Bram Moolenaare4f25e42017-07-07 11:54:15 +02001Sequences documented in parens are implicit ones from parser.c, which move
2between states.
3
41 = VT100
52 = VT220
63 = VT320
Bram Moolenaar7da34152021-11-24 19:30:55 +00007x = xterm
Bram Moolenaare4f25e42017-07-07 11:54:15 +02008
Bram Moolenaar7da34152021-11-24 19:30:55 +00009 C0 controls
Bram Moolenaare4f25e42017-07-07 11:54:15 +020010
Bram Moolenaar7da34152021-11-24 19:30:55 +000011123 0x00 = NUL
12123x 0x07 = BEL
13123x 0x08 = BS
14123x 0x09 = HT
15123x 0x0A = LF
16123x 0x0B = VT
17123x 0x0C = FF
18123x 0x0D = CR
19123x 0x0E = LS1
20123x 0x0F = LS0
21 (0x18 = CAN)
22 (0x1A = SUB)
23 (0x1B = ESC)
Bram Moolenaare4f25e42017-07-07 11:54:15 +020024
Bram Moolenaar7da34152021-11-24 19:30:55 +000025123 0x7f = DEL (ignored)
Bram Moolenaare4f25e42017-07-07 11:54:15 +020026
Bram Moolenaar7da34152021-11-24 19:30:55 +000027 C1 controls
Bram Moolenaare4f25e42017-07-07 11:54:15 +020028
Bram Moolenaar7da34152021-11-24 19:30:55 +000029123x 0x84 = IND
30123x 0x85 = NEL
31123x 0x88 = HTS
32123x 0x8D = RI
33 23x 0x8E = SS2
34 23x 0x8F = SS3
35 (0x90 = DCS)
36 (0x98 = SOS)
37 (0x9B = CSI)
38 (0x9C = ST)
39 (0x9D = OSC)
40 (0x9E = PM)
41 (0x9F = APC)
Bram Moolenaare4f25e42017-07-07 11:54:15 +020042
Bram Moolenaar7da34152021-11-24 19:30:55 +000043 Escape sequences
44 - excluding sequences that are C1 aliases
Bram Moolenaare4f25e42017-07-07 11:54:15 +020045
Bram Moolenaar7da34152021-11-24 19:30:55 +000046123x ESC ( = SCS, select character set G0
47123x ESC ) = SCS, select character set G1
48 23x ESC * = SCS, select character set G2
49 23x ESC + = SCS, select character set G3
50123x ESC 7 = DECSC - save cursor
51123x ESC 8 = DECRC - restore cursor
52123x ESC # 3 = DECDHL, double-height line (top half)
53123x ESC # 4 = DECDHL, double-height line (bottom half)
54123x ESC # 5 = DECSWL, single-width single-height line
55123x ESC # 6 = DECDWL, double-width single-height line
56123x ESC # 8 = DECALN
57123 ESC < = Ignored (used by VT100 to exit VT52 mode)
58123x ESC = = DECKPAM, keypad application mode
59123x ESC > = DECKPNM, keypad numeric mode
60 23x ESC Sp F = S7C1T
61 23x ESC Sp G = S8C1T
62 (ESC P = DCS)
63 (ESC X = SOS)
64 (ESC [ = CSI)
65 (ESC \ = ST)
66 (ESC ] = OSC)
67 (ESC ^ = PM)
68 (ESC _ = APC)
69123x ESC c = RIS, reset initial state
70 3x ESC n = LS2
71 3x ESC o = LS3
72 3x ESC | = LS3R
73 3x ESC } = LS2R
74 3x ESC ~ = LS1R
Bram Moolenaare4f25e42017-07-07 11:54:15 +020075
Bram Moolenaar7da34152021-11-24 19:30:55 +000076 DCSes
Bram Moolenaare4f25e42017-07-07 11:54:15 +020077
Bram Moolenaar7da34152021-11-24 19:30:55 +000078 3x DCS $ q ST = DECRQSS
79 3x m = Request SGR
80 x Sp q = Request DECSCUSR
81 3x " q = Request DECSCA
82 3x r = Request DECSTBM
83 x s = Request DECSLRM
Bram Moolenaare4f25e42017-07-07 11:54:15 +020084
Bram Moolenaar7da34152021-11-24 19:30:55 +000085 CSIs
86 23x CSI @ = ICH
87123x CSI A = CUU
88123x CSI B = CUD
89123x CSI C = CUF
90123x CSI D = CUB
91 x CSI E = CNL
92 x CSI F = CPL
93 x CSI G = CHA
94123x CSI H = CUP
95 x CSI I = CHT
96123x CSI J = ED
97 23x CSI ? J = DECSED, selective erase in display
98123x CSI K = EL
99 23x CSI ? K = DECSEL, selective erase in line
100 23x CSI L = IL
101 23x CSI M = DL
102 23x CSI P = DCH
103 x CSI S = SU
104 x CSI T = SD
105 23x CSI X = ECH
106 x CSI Z = CBT
107 x CSI ` = HPA
108 x CSI a = HPR
109 x CSI b = REP
110123x CSI c = DA, device attributes
111123 0 = DA
112 23x CSI > c = DECSDA
113 23 0 = SDA
114 x CSI d = VPA
115 x CSI e = VPR
116123x CSI f = HVP
117123x CSI g = TBC
118123x CSI h = SM, Set mode
119123x CSI ? h = DECSM, DEC set mode
120 CSI j = HPB
121 CSI k = VPB
122123x CSI l = RM, Reset mode
123123x CSI ? l = DECRM, DEC reset mode
124123x CSI m = SGR, Set Graphic Rendition
125123x CSI n = DSR, Device Status Report
126 23x 5 = operating status
127 23x 6 = CPR = cursor position
128 23x CSI ? n = DECDSR; behaves as DSR but uses CSI ? instead of CSI to respond
129 23x CSI ! p = DECSTR, soft terminal reset
130 3x CSI ? $ p = DECRQM, request private mode
131 x CSI Sp q = DECSCUSR (odd numbers blink, even numbers solid)
132 1 or 2 = block
133 3 or 4 = underline
134 5 or 6 = I-beam to left
Bram Moolenaar501e7772022-10-16 14:35:46 +0100135 x CSI > q = XTVERSION, request version string
Bram Moolenaar7da34152021-11-24 19:30:55 +0000136 23x CSI " q = DECSCA, select character attributes
137123x CSI r = DECSTBM
138 x CSI s = DECSLRM
139 x CSI ' } = DECIC
140 x CSI ' ~ = DECDC
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200141
Bram Moolenaar7da34152021-11-24 19:30:55 +0000142 OSCs
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200143
Bram Moolenaar7da34152021-11-24 19:30:55 +0000144 x OSC 0; = Set icon name and title
145 x OSC 1; = Set icon name
146 x OSC 2; = Set title
147 x OSC 52; = Selection management
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200148
Bram Moolenaar7da34152021-11-24 19:30:55 +0000149 Standard modes
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200150
Bram Moolenaar7da34152021-11-24 19:30:55 +0000151 23x SM 4 = IRM
152123x SM 20 = NLM, linefeed/newline
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200153
Bram Moolenaar7da34152021-11-24 19:30:55 +0000154 DEC modes
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200155
Bram Moolenaar7da34152021-11-24 19:30:55 +0000156123x DECSM 1 = DECCKM, cursor keys
157123x DECSM 5 = DECSCNM, screen
158123x DECSM 6 = DECOM, origin
159123x DECSM 7 = DECAWM, autowrap
160 x DECSM 12 = Cursor blink
161 23x DECSM 25 = DECTCEM, text cursor enable
162 x DECSM 69 = DECVSSM, vertical screen split
163 x DECSM 1000 = Mouse click/release tracking
164 x DECSM 1002 = Mouse click/release/drag tracking
165 x DECSM 1003 = Mouse all movements tracking
166 x DECSM 1004 = Focus in/out reporting
167 x DECSM 1005 = Mouse protocol extended (UTF-8) - not recommended
168 x DECSM 1006 = Mouse protocol SGR
169 x DECSM 1015 = Mouse protocol rxvt
170 x DECSM 1047 = Altscreen
171 x DECSM 1048 = Save cursor
172 x DECSM 1049 = 1047 + 1048
173 x DECSM 2004 = Bracketed paste
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200174
Bram Moolenaar7da34152021-11-24 19:30:55 +0000175 Graphic Renditions
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200176
Bram Moolenaar7da34152021-11-24 19:30:55 +0000177123x SGR 0 = Reset
178123x SGR 1 = Bold on
179 x SGR 3 = Italic on
180123x SGR 4 = Underline single
181 SGR 4:x = Underline style
182123x SGR 5 = Blink on
183123x SGR 7 = Reverse on
184 x SGR 8 = Conceal on
185 x SGR 9 = Strikethrough on
186 SGR 10-19 = Select font
187 x SGR 21 = Underline double
188 23x SGR 22 = Bold off
189 x SGR 23 = Italic off
190 23x SGR 24 = Underline off
191 23x SGR 25 = Blink off
192 23x SGR 27 = Reverse off
193 x SGR 28 = Conceal off
194 x SGR 29 = Strikethrough off
195 x SGR 30-37 = Foreground ANSI
196 x SGR 38 = Foreground alternative palette
197 x SGR 39 = Foreground default
198 x SGR 40-47 = Background ANSI
199 x SGR 48 = Background alternative palette
200 x SGR 49 = Background default
201 x SGR 90-97 = Foreground ANSI high-intensity
202 x SGR 100-107 = Background ANSI high-intensity
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200203
204The state storage used by ESC 7 and DECSM 1048/1049 is shared.
205
Bram Moolenaar7da34152021-11-24 19:30:55 +0000206 Unimplemented sequences:
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200207
208The following sequences are not recognised by libvterm.
209
Bram Moolenaar7da34152021-11-24 19:30:55 +0000210123x 0x05 = ENQ
211 3 0x11 = DC1 (XON)
212 3 0x13 = DC3 (XOFF)
213 x ESC % @ = Select default character set
214 x ESC % G = Select UTF-8 character set
215 x ESC 6 = DECBI, Back Index
21612 ESC Z = DECID, identify terminal
217 x DCS + Q = XTGETXRES, Request resource values
218 DCS $ q = [DECRQSS]
219 3x " p = Request DECSCL
220 x t = Request DECSLPP
221 x $ | = Request DECSCPP
222 x * | = Request DECSLNS
223 3 $ } = Request DECSASD
224 3 $ ~ = Request DECSSDT
225 x DCS + p = XTSETTCAP, set termcap/terminfo data
226 x DCS + q = XTGETTCAP, request termcap/terminfo
227 23 DCS { = DECDLD, down-line-loadable character set
228 23x DCS | = DECUDK, user-defined key
229 x CSI Sp @ = Shift left columns
230 x CSI Sp A = Shift right columns
231 x CSI # P = XTPUSHCOLORS, push current dynamic colours to stack
232 x CSI # Q = XTPOPCOLORS, pop dynamic colours from stack
233 x CSI # R = XTREPORTCOLORS, report current entry on palette stack
234 x CSI ? S = XTSMGRAPHICS, set/request graphics attribute
235 x CSI > T = XTRMTITLE, reset title mode features
236 23x CSI i = DEC printer control
237 x CSI > m = XTMODKEYS, set key modifier options
238 x CSI > n = (XTMODKEYS), reset key modifier options
239 x CSI $ p = DECRQM, request ANSI mode
240 23x CSI " p = DECSCL, set compatibility level
241 x CSI > p = XTSMPOINTER, set resource value pointer mode
2421 x CSI q = DECLL, load LEDs
243 x CSI ? r = XTRESTORE, restore DEC private mode values
244 x CSI $ r = DECCARA, change attributes in rectangular area
245 x CSI > s = XTSHIFTESCAPE, set/reset shift-escape options
246 x CSI ? s = XTSAVE, save DEC private mode values
247 x CSI t = XTWINOPS, window operations
248 x CSI > t = XTSMTITLE, set title mode features
249 x CSI $ t = DECRARA, reset attributes in rectangular area
250 3 CSI $ u = DECRQTSR, request terminal state report
251 3 1 = terminal state report
252 3 CSI & u = DECRQUPSS, request user-preferred supplemental set
253 x CSI $ v = DECCRA, copy rectangular area
254 3x CSI $ w = DECRQPSR, request presentation state report
255 3x 1 = cursor information report
256 3x 2 = tab stop report
257 x CSI ' w = DECEFR, enable filter rectangle
2581 x CSI x = DECREQTPARM, request terminal parameters
259 x CSI * x = DECSACE, select attribute change extent
260 x CSI $ x = DECFRA, fill rectangular area
261123 CSI y = DECTST, invoke confidence test
262 x CSI $ z = DECERA, erase rectangular area
263 x CSI # { = XTPUSHSGR, push video attributes onto stack
264 x CSI $ { = DECSERA, selective erase in rectangular area
265 x CSI # | = XTREPORTSGR, report selected graphic rendition
266 x CSI $ | = DECSCPP, select columns per page
267 x CSI # } = XTPOPSGR, pop video attributes from stack
268 3 CSI $ } = DECSASD, select active status display
269 3 CSI $ ~ = DECSSDT, select status line type
270 23 SM 2 = KAM, keyboard action
271123 SM 12 = SRM, send/receive
272123 DECSM 2 = DECANM, ANSI/VT52
273123 DECSM 3 = DECCOLM, 132 column
274123 DECSM 4 = DECSCLM, scrolling
275123 DECSM 8 = DECARM, auto-repeat
27612 DECSM 9 = DECINLM, interlace
277 23 DECSM 18 = DECPFF, print form feed
278 23 DECSM 19 = DECPEX, print extent
279 23 DECSM 42 = DECNRCM, national/multinational character