blob: 27f28b91b6d16a8c1148ba2d4d30f610fc0a13b9 [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
Bram Moolenaar6a12d262022-10-16 19:26:52 +0100125 CSI ? m = DECSGR, private Set Graphic Rendition
Bram Moolenaar7da34152021-11-24 19:30:55 +0000126123x CSI n = DSR, Device Status Report
127 23x 5 = operating status
128 23x 6 = CPR = cursor position
129 23x CSI ? n = DECDSR; behaves as DSR but uses CSI ? instead of CSI to respond
130 23x CSI ! p = DECSTR, soft terminal reset
131 3x CSI ? $ p = DECRQM, request private mode
132 x CSI Sp q = DECSCUSR (odd numbers blink, even numbers solid)
133 1 or 2 = block
134 3 or 4 = underline
135 5 or 6 = I-beam to left
Bram Moolenaar501e7772022-10-16 14:35:46 +0100136 x CSI > q = XTVERSION, request version string
Bram Moolenaar7da34152021-11-24 19:30:55 +0000137 23x CSI " q = DECSCA, select character attributes
138123x CSI r = DECSTBM
139 x CSI s = DECSLRM
140 x CSI ' } = DECIC
141 x CSI ' ~ = DECDC
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200142
Bram Moolenaar7da34152021-11-24 19:30:55 +0000143 OSCs
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200144
Bram Moolenaar7da34152021-11-24 19:30:55 +0000145 x OSC 0; = Set icon name and title
146 x OSC 1; = Set icon name
147 x OSC 2; = Set title
148 x OSC 52; = Selection management
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200149
Bram Moolenaar7da34152021-11-24 19:30:55 +0000150 Standard modes
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200151
Bram Moolenaar7da34152021-11-24 19:30:55 +0000152 23x SM 4 = IRM
153123x SM 20 = NLM, linefeed/newline
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200154
Bram Moolenaar7da34152021-11-24 19:30:55 +0000155 DEC modes
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200156
Bram Moolenaar7da34152021-11-24 19:30:55 +0000157123x DECSM 1 = DECCKM, cursor keys
158123x DECSM 5 = DECSCNM, screen
159123x DECSM 6 = DECOM, origin
160123x DECSM 7 = DECAWM, autowrap
161 x DECSM 12 = Cursor blink
162 23x DECSM 25 = DECTCEM, text cursor enable
163 x DECSM 69 = DECVSSM, vertical screen split
164 x DECSM 1000 = Mouse click/release tracking
165 x DECSM 1002 = Mouse click/release/drag tracking
166 x DECSM 1003 = Mouse all movements tracking
167 x DECSM 1004 = Focus in/out reporting
168 x DECSM 1005 = Mouse protocol extended (UTF-8) - not recommended
169 x DECSM 1006 = Mouse protocol SGR
170 x DECSM 1015 = Mouse protocol rxvt
171 x DECSM 1047 = Altscreen
172 x DECSM 1048 = Save cursor
173 x DECSM 1049 = 1047 + 1048
174 x DECSM 2004 = Bracketed paste
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200175
Bram Moolenaar7da34152021-11-24 19:30:55 +0000176 Graphic Renditions
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200177
Bram Moolenaar7da34152021-11-24 19:30:55 +0000178123x SGR 0 = Reset
179123x SGR 1 = Bold on
180 x SGR 3 = Italic on
181123x SGR 4 = Underline single
182 SGR 4:x = Underline style
183123x SGR 5 = Blink on
184123x SGR 7 = Reverse on
185 x SGR 8 = Conceal on
186 x SGR 9 = Strikethrough on
187 SGR 10-19 = Select font
188 x SGR 21 = Underline double
189 23x SGR 22 = Bold off
190 x SGR 23 = Italic off
191 23x SGR 24 = Underline off
192 23x SGR 25 = Blink off
193 23x SGR 27 = Reverse off
194 x SGR 28 = Conceal off
195 x SGR 29 = Strikethrough off
196 x SGR 30-37 = Foreground ANSI
197 x SGR 38 = Foreground alternative palette
198 x SGR 39 = Foreground default
199 x SGR 40-47 = Background ANSI
200 x SGR 48 = Background alternative palette
201 x SGR 49 = Background default
Bram Moolenaar6a12d262022-10-16 19:26:52 +0100202 SGR 73 = Superscript on
203 SGR 74 = Subscript on
204 SGR 75 = Superscript/subscript off
Bram Moolenaar7da34152021-11-24 19:30:55 +0000205 x SGR 90-97 = Foreground ANSI high-intensity
206 x SGR 100-107 = Background ANSI high-intensity
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200207
208The state storage used by ESC 7 and DECSM 1048/1049 is shared.
209
Bram Moolenaar7da34152021-11-24 19:30:55 +0000210 Unimplemented sequences:
Bram Moolenaare4f25e42017-07-07 11:54:15 +0200211
212The following sequences are not recognised by libvterm.
213
Bram Moolenaar7da34152021-11-24 19:30:55 +0000214123x 0x05 = ENQ
215 3 0x11 = DC1 (XON)
216 3 0x13 = DC3 (XOFF)
217 x ESC % @ = Select default character set
218 x ESC % G = Select UTF-8 character set
219 x ESC 6 = DECBI, Back Index
22012 ESC Z = DECID, identify terminal
221 x DCS + Q = XTGETXRES, Request resource values
222 DCS $ q = [DECRQSS]
223 3x " p = Request DECSCL
224 x t = Request DECSLPP
225 x $ | = Request DECSCPP
226 x * | = Request DECSLNS
227 3 $ } = Request DECSASD
228 3 $ ~ = Request DECSSDT
229 x DCS + p = XTSETTCAP, set termcap/terminfo data
230 x DCS + q = XTGETTCAP, request termcap/terminfo
231 23 DCS { = DECDLD, down-line-loadable character set
232 23x DCS | = DECUDK, user-defined key
233 x CSI Sp @ = Shift left columns
234 x CSI Sp A = Shift right columns
235 x CSI # P = XTPUSHCOLORS, push current dynamic colours to stack
236 x CSI # Q = XTPOPCOLORS, pop dynamic colours from stack
237 x CSI # R = XTREPORTCOLORS, report current entry on palette stack
238 x CSI ? S = XTSMGRAPHICS, set/request graphics attribute
239 x CSI > T = XTRMTITLE, reset title mode features
240 23x CSI i = DEC printer control
241 x CSI > m = XTMODKEYS, set key modifier options
242 x CSI > n = (XTMODKEYS), reset key modifier options
243 x CSI $ p = DECRQM, request ANSI mode
244 23x CSI " p = DECSCL, set compatibility level
245 x CSI > p = XTSMPOINTER, set resource value pointer mode
2461 x CSI q = DECLL, load LEDs
247 x CSI ? r = XTRESTORE, restore DEC private mode values
248 x CSI $ r = DECCARA, change attributes in rectangular area
249 x CSI > s = XTSHIFTESCAPE, set/reset shift-escape options
250 x CSI ? s = XTSAVE, save DEC private mode values
251 x CSI t = XTWINOPS, window operations
252 x CSI > t = XTSMTITLE, set title mode features
253 x CSI $ t = DECRARA, reset attributes in rectangular area
254 3 CSI $ u = DECRQTSR, request terminal state report
255 3 1 = terminal state report
256 3 CSI & u = DECRQUPSS, request user-preferred supplemental set
257 x CSI $ v = DECCRA, copy rectangular area
258 3x CSI $ w = DECRQPSR, request presentation state report
259 3x 1 = cursor information report
260 3x 2 = tab stop report
261 x CSI ' w = DECEFR, enable filter rectangle
2621 x CSI x = DECREQTPARM, request terminal parameters
263 x CSI * x = DECSACE, select attribute change extent
264 x CSI $ x = DECFRA, fill rectangular area
265123 CSI y = DECTST, invoke confidence test
266 x CSI $ z = DECERA, erase rectangular area
267 x CSI # { = XTPUSHSGR, push video attributes onto stack
268 x CSI $ { = DECSERA, selective erase in rectangular area
269 x CSI # | = XTREPORTSGR, report selected graphic rendition
270 x CSI $ | = DECSCPP, select columns per page
271 x CSI # } = XTPOPSGR, pop video attributes from stack
272 3 CSI $ } = DECSASD, select active status display
273 3 CSI $ ~ = DECSSDT, select status line type
274 23 SM 2 = KAM, keyboard action
275123 SM 12 = SRM, send/receive
276123 DECSM 2 = DECANM, ANSI/VT52
277123 DECSM 3 = DECCOLM, 132 column
278123 DECSM 4 = DECSCLM, scrolling
279123 DECSM 8 = DECARM, auto-repeat
28012 DECSM 9 = DECINLM, interlace
281 23 DECSM 18 = DECPFF, print form feed
282 23 DECSM 19 = DECPEX, print extent
283 23 DECSM 42 = DECNRCM, national/multinational character