"Fossies" - the Fresh Open Source Software Archive 
Member "xterm-379/ctlseqs.txt" (12 Feb 2023, 146116 Bytes) of package /linux/misc/xterm-379.tgz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "ctlseqs.txt":
377_vs_379.
1
2
3
4
5
6
7
8
9
10 XTerm Control Sequences
11
12
13 Edward Moy
14 University of California, Berkeley
15
16 Revised by
17
18 Stephen Gildea
19 X Consortium (1994)
20
21 Thomas Dickey
22 XFree86 Project (1996-2006)
23 invisible-island.net (2006-2023)
24 updated for XTerm Patch #379 (2023/02/12)
25
26
27
28
29 Definitions
30
31 Many controls use parameters, shown in italics. If a control uses a
32 single parameter, only one parameter name is listed. Some parameters
33 (along with separating ; characters) may be optional. Other characters
34 in the control are required.
35
36 C A single (required) character.
37
38 Ps A single (usually optional) numeric parameter, composed of one or
39 more digits.
40
41 Pm Any number of single numeric parameters, separated by ;
42 character(s). Individual values for the parameters are listed with
43 Ps .
44
45 Pt A text parameter composed of printable characters.
46
47
48 Control Bytes, Characters, and Sequences
49
50 ECMA-48 (aka "ISO 6429") documents C1 (8-bit) and C0 (7-bit) codes.
51 Those are respectively codes 128 to 159 and 0 to 31. ECMA-48 avoids
52 referring to these codes as characters, because that term is associated
53 with graphic characters. Instead, it uses "bytes" and "codes", with
54 occasional lapses to "characters" where the meaning cannot be mistaken.
55
56 Controls (including the escape code 27) are processed once:
57
58 o This means that a C1 control can be mistaken for badly-formed UTF-8
59 when the terminal runs in UTF-8 mode because C1 controls are valid
60 continuation bytes of a UTF-8 encoded (multibyte) value.
61
62 o It is not possible to use a C1 control obtained from decoding the
63 UTF-8 text, because that would require reprocessing the data.
64 Consequently there is no ambiguity in the way this document uses the
65 term "character" to refer to bytes in a control sequence.
66
67 The order of processing is a necessary consequence of the way ECMA-48 is
68 designed:
69
70 o Each byte sent to the terminal can be unambiguously determined to
71 fall into one of a few categories (C0, C1 and graphic characters).
72
73 o ECMA-48 is modal; once it starts processing a control sequence, the
74 terminal continues until the sequence is complete, or some byte is
75 found which is not allowed in the sequence.
76
77 o Intermediate, parameter and final bytes may use the same codes as
78 graphic characters, but they are processed as part of a control
79 sequence and are not actually graphic characters.
80
81 o Eight-bit controls can have intermediate, etc., bytes in the range
82 160 to 255. Those can be treated as their counterparts in the range
83 32 to 127.
84
85 o Single-byte controls can be handled separately from multi-byte
86 control sequences because ECMA-48's rules are unambiguous.
87
88 As a special case, ECMA-48 (section 9) mentions that the control
89 functions shift-in and shift-out are allowed to occur within a 7-bit
90 multibyte control sequence because those cannot alter the meaning of
91 the control sequence.
92
93 o Some controls (such as OSC ) introduce a string mode, which is ended
94 on a ST (string terminator).
95
96 ECMA-48 describes only correct behavior, telling what types of
97 characters are expected at each stage of the control sequences. It
98 says that the action taken in error recovery is implementation-
99 dependent. XTerm decodes control sequences using a state machine.
100 It handles errors in decoding i.e., unexpected characters, by
101 resetting to the initial (ground) state. That is different from the
102 treatment of unimplemented (but correctly formatted) features.
103
104 If an application does not send the string terminator, that is also
105 an error from the standpoint of a user. To accommodate users of
106 those applications, xterm has resource settings which allow
107 workarounds:
108
109 o The Linux console's palette sequences do not use a string
110 terminator. The brokenLinuxOSC resource setting tells xterm to
111 ignore those particular sequences.
112
113 o The terminal should accept single-byte controls within the
114 string. But some applications omit a string terminator, like
115 the Linux console. The brokenStringTerm resource setting tells
116 xterm to exit string mode if it decodes a common control
117 character such as carriage return before the string terminator.
118
119
120 C1 (8-Bit) Control Characters
121
122 The xterm program recognizes both 8-bit and 7-bit control characters.
123 It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
124 The following pairs of 7-bit and 8-bit control characters are
125 equivalent:
126
127 ESC D
128 Index (IND is 0x84).
129
130 ESC E
131 Next Line (NEL is 0x85).
132
133 ESC H
134 Tab Set (HTS is 0x88).
135
136 ESC M
137 Reverse Index (RI is 0x8d).
138
139 ESC N
140 Single Shift Select of G2 Character Set (SS2 is 0x8e), VT220.
141 This affects next character only.
142
143 ESC O
144 Single Shift Select of G3 Character Set (SS3 is 0x8f), VT220.
145 This affects next character only.
146
147 ESC P
148 Device Control String (DCS is 0x90).
149
150 ESC V
151 Start of Guarded Area (SPA is 0x96).
152
153 ESC W
154 End of Guarded Area (EPA is 0x97).
155
156 ESC X
157 Start of String (SOS is 0x98).
158
159 ESC Z
160 Return Terminal ID (DECID is 0x9a). Obsolete form of CSI c (DA).
161
162 ESC [
163 Control Sequence Introducer (CSI is 0x9b).
164
165 ESC \
166 String Terminator (ST is 0x9c).
167
168 ESC ]
169 Operating System Command (OSC is 0x9d).
170
171 ESC ^
172 Privacy Message (PM is 0x9e).
173
174 ESC _
175 Application Program Command (APC is 0x9f).
176
177
178 These control characters are used in the vtXXX emulation.
179
180
181 VT100-related terminals
182
183 In this document, "VT100" refers not only to VT100/VT102, but also to
184 the succession of upward-compatible terminals produced by DEC (Digital
185 Equipment Corporation) from the mid-1970s for about twenty years. For
186 brevity, the document refers to the related models:
187 "VT200" as VT220/VT240,
188 "VT300" as VT320/VT340,
189 "VT400" as VT420, and
190 "VT500" as VT510/VT520/VT525.
191
192 Most of these control sequences are standard VT102 control sequences,
193 but there is support for later DEC VT terminals (i.e., VT220, VT320,
194 VT420, VT510), as well as ECMA-48 and aixterm color controls. The only
195 VT102 feature not supported is auto-repeat, since the only way X
196 provides for this will affect all windows.
197
198 There are additional control sequences to provide xterm-dependent
199 functions, such as the scrollbar or window size. Where the function is
200 specified by DEC or ECMA-48, the mnemonic assigned to it is given in
201 parentheses.
202
203 The escape codes to designate and invoke character sets are specified by
204 ISO 2022 (see that document for a discussion of character sets).
205
206 Many of the features are optional; xterm can be configured and built
207 without support for them.
208
209
210 VT100 Mode
211
212
213 Single-character functions
214
215 BEL Bell (BEL is Ctrl-G).
216
217 BS Backspace (BS is Ctrl-H).
218
219 CR Carriage Return (CR is Ctrl-M).
220
221 ENQ Return Terminal Status (ENQ is Ctrl-E). Default response is
222 an empty string, but may be overridden by a resource
223 answerbackString.
224
225 FF Form Feed or New Page (NP ). (FF is Ctrl-L). FF is treated
226 the same as LF .
227
228 LF Line Feed or New Line (NL). (LF is Ctrl-J).
229
230 SI Switch to Standard Character Set (Ctrl-O is Shift In or LS0).
231 This invokes the G0 character set (the default) as GL.
232 VT200 and up implement LS0.
233
234 SO Switch to Alternate Character Set (Ctrl-N is Shift Out or
235 LS1). This invokes the G1 character set as GL.
236 VT200 and up implement LS1.
237
238 SP Space.
239
240 TAB Horizontal Tab (HTS is Ctrl-I).
241
242 VT Vertical Tab (VT is Ctrl-K). This is treated the same as LF.
243
244
245 Controls beginning with ESC
246
247 This excludes controls where ESC is part of a 7-bit equivalent to 8-bit
248 C1 controls, ordered by the final character(s).
249
250 ESC SP F 7-bit controls (S7C1T), VT220. This tells the terminal to
251 send C1 control characters as 7-bit sequences, e.g., its
252 responses to queries. DEC VT200 and up always accept 8-bit
253 control sequences except when configured for VT100 mode.
254
255 ESC SP G 8-bit controls (S8C1T), VT220. This tells the terminal to
256 send C1 control characters as 8-bit sequences, e.g., its
257 responses to queries. DEC VT200 and up always accept 8-bit
258 control sequences except when configured for VT100 mode.
259
260 ESC SP L Set ANSI conformance level 1, ECMA-43.
261
262 ESC SP M Set ANSI conformance level 2, ECMA-43.
263
264 ESC SP N Set ANSI conformance level 3, ECMA-43.
265
266 ESC # 3 DEC double-height line, top half (DECDHL), VT100.
267
268 ESC # 4 DEC double-height line, bottom half (DECDHL), VT100.
269
270 ESC # 5 DEC single-width line (DECSWL), VT100.
271
272 ESC # 6 DEC double-width line (DECDWL), VT100.
273
274 ESC # 8 DEC Screen Alignment Test (DECALN), VT100.
275
276 ESC % @ Select default character set. That is ISO 8859-1 (ISO 2022).
277
278 ESC % G Select UTF-8 character set, ISO 2022.
279
280 ESC ( C Designate G0 Character Set, VT100, ISO 2022.
281 Final character C for designating 94-character sets. In this
282 list,
283 o 0 , A and B were introduced in the VT100,
284 o most were introduced in the VT200 series,
285 o a few were introduced in the VT300 series, and
286 o a few more were introduced in the VT500 series.
287 The VT220 character sets, together with a few others (such as
288 Portuguese) are activated by the National Replacement
289 Character Set (NRCS) controls. The term "replacement" says
290 that the character set is formed by replacing some of the
291 characters in a set (termed the Multinational Character Set)
292 with more useful ones for a given language. The ASCII and DEC
293 Supplemental character sets make up the two halves of the
294 Multinational Character set, initially mapped to GL and GR.
295 The valid final characters C for this control are:
296 C = A -> United Kingdom (UK), VT100.
297 C = B -> United States (USASCII), VT100.
298 C = C or 5 -> Finnish, VT200.
299 C = H or 7 -> Swedish, VT200.
300 C = K -> German, VT200.
301 C = Q or 9 -> French Canadian, VT200.
302 C = R or f -> French, VT200.
303 C = Y -> Italian, VT200.
304 C = Z -> Spanish, VT200.
305 C = 4 -> Dutch, VT200.
306 C = " > -> Greek, VT500.
307 C = % 2 -> Turkish, VT500.
308 C = % 6 -> Portuguese, VT300.
309 C = % = -> Hebrew, VT500.
310 C = = -> Swiss, VT200.
311 C = ` , E or 6 -> Norwegian/Danish, VT200.
312 The final character A is a special case, since the same final
313 character is used by the VT300-control for the 96-character
314 British Latin-1.
315 There are a few other 94-character sets:
316 C = 0 -> DEC Special Character and Line Drawing Set, VT100.
317 C = < -> DEC Supplemental, VT200.
318 C = > -> DEC Technical, VT300.
319 These are documented as 94-character sets (like USASCII)
320 without NRCS:
321 C = " 4 -> DEC Hebrew, VT500.
322 C = " ? -> DEC Greek, VT500.
323 C = % 0 -> DEC Turkish, VT500.
324 C = % 5 -> DEC Supplemental Graphics, VT300.
325 C = & 4 -> DEC Cyrillic, VT500.
326 The VT520 reference manual lists a few more, but no
327 documentation has been found for the mappings:
328 C = % 3 -> SCS NRCS, VT500.
329 C = & 5 -> DEC Russian, VT500.
330
331 ESC ) C Designate G1 Character Set, ISO 2022, VT100.
332 The same character sets apply as for ESC ( C.
333
334 ESC * C Designate G2 Character Set, ISO 2022, VT220.
335 The same character sets apply as for ESC ( C.
336
337 ESC + C Designate G3 Character Set, ISO 2022, VT220.
338 The same character sets apply as for ESC ( C.
339
340 ESC - C Designate G1 Character Set, VT300.
341 These controls apply only to 96-character sets. Unlike the
342 94-character sets, these can have different values than ASCII
343 space and DEL for the mapping of 0x20 and 0x7f. The valid
344 final characters C for this control are:
345 C = A -> ISO Latin-1 Supplemental, VT300.
346 C = B -> ISO Latin-2 Supplemental, VT500.
347 C = F -> ISO Greek Supplemental, VT500.
348 C = H -> ISO Hebrew Supplemental, VT500.
349 C = L -> ISO Latin-Cyrillic, VT500.
350 C = M -> ISO Latin-5 Supplemental, VT500.
351
352 ESC . C Designate G2 Character Set, VT300.
353 The same character sets apply as for ESC - C.
354
355 ESC / C Designate G3 Character Set, VT300.
356 The same character sets apply as for ESC - C.
357
358 ESC 6 Back Index (DECBI), VT420 and up.
359
360 ESC 7 Save Cursor (DECSC), VT100.
361
362 ESC 8 Restore Cursor (DECRC), VT100.
363
364 ESC 9 Forward Index (DECFI), VT420 and up.
365
366 ESC = Application Keypad (DECKPAM).
367
368 ESC > Normal Keypad (DECKPNM), VT100.
369
370 ESC F Cursor to lower left corner of screen. This is enabled by the
371 hpLowerleftBugCompat resource.
372
373 ESC c Full Reset (RIS), VT100.
374
375 ESC l Memory Lock (per HP terminals). Locks memory above the
376 cursor.
377
378 ESC m Memory Unlock (per HP terminals).
379
380 ESC n Invoke the G2 Character Set as GL (LS2).
381
382 ESC o Invoke the G3 Character Set as GL (LS3).
383
384 ESC | Invoke the G3 Character Set as GR (LS3R).
385
386 ESC } Invoke the G2 Character Set as GR (LS2R).
387
388 ESC ~ Invoke the G1 Character Set as GR (LS1R), VT100.
389
390
391 Application Program-Command functions
392
393 APC Pt ST None. xterm implements no APC functions; Pt is ignored. Pt
394 need not be printable characters.
395
396
397 Device-Control functions
398
399 DCS Ps ; Ps | Pt ST
400 User-Defined Keys (DECUDK), VT220 and up.
401
402 The first parameter:
403 Ps = 0 -> Clear all UDK definitions before starting
404 (default).
405 Ps = 1 -> Erase Below (default).
406
407 The second parameter:
408 Ps = 0 <- Lock the keys (default).
409 Ps = 1 <- Do not lock.
410
411 The third parameter is a ";"-separated list of strings
412 denoting the key-code separated by a "/" from the hex-encoded
413 key value. The key codes correspond to the DEC function-key
414 codes (e.g., F6=17).
415
416 DCS $ q Pt ST
417 Request Status String (DECRQSS), VT420 and up.
418 The string following the "q" is one of the following:
419 m -> SGR
420 " p -> DECSCL
421 SP q -> DECSCUSR
422 " q -> DECSCA
423 r -> DECSTBM
424 s -> DECSLRM
425 t -> DECSLPP
426 $ | -> DECSCPP
427 $ } -> DECSASD
428 $ ~ -> DECSSDT
429 * | -> DECSNLS
430 xterm responds with DCS 1 $ r Pt ST for valid requests,
431 replacing the Pt with the corresponding CSI string, or DCS 0 $
432 r ST for invalid requests.
433
434 DCS Ps $ t Pt ST
435 Restore presentation status (DECRSPS), VT320 and up. The
436 control can be converted from a response from DECCIR or
437 DECTABSR by changing the first "u" to a "t"
438 Ps = 1 -> DECCIR
439 Ps = 2 -> DECTABSR
440
441 DCS + Q Pt ST
442 Request resource values (XTGETXRES), xterm. The string
443 following the "Q" is a list of names encoded in hexadecimal (2
444 digits per character) separated by ; which correspond to xterm
445 resource names.
446
447 xterm responds with
448 DCS 1 + R Pt ST for valid requests, adding to Pt an = , and
449 the value of the corresponding xterm resource, or
450 DCS 0 + R Pt ST for invalid requests.
451 The strings are encoded in hexadecimal (2 digits per
452 character).
453
454 Only boolean, numeric and string resources for the VT100
455 widget are supported by this query. XTerm evaluates resources
456 at startup time. Several of xterm's state variables use
457 resources to determine their initial value. Because the
458 resource variable may not reflect the current state, xterm
459 provides control sequences for querying the state directly:
460
461 o XTQALLOWED
462 o XTQMODKEYS
463
464
465 DCS + p Pt ST
466 Set Termcap/Terminfo Data (XTSETTCAP), xterm. The string
467 following the "p" is encoded in hexadecimal. After decoding
468 it, xterm will use the name to retrieve data from the terminal
469 database. If successful, that overrides the termName resource
470 when handling the "tcap" keyboard configuration's function-
471 and special-keys, as well as by the Request Termcap/Terminfo
472 String control.
473
474
475 DCS + q Pt ST
476 Request Termcap/Terminfo String (XTGETTCAP), xterm. The
477 string following the "q" is a list of names encoded in
478 hexadecimal (2 digits per character) separated by ; which
479 correspond to termcap or terminfo key names.
480 A few special features are also recognized, which are not key
481 names:
482
483 o Co for termcap colors (or colors for terminfo colors), and
484
485 o TN for termcap name (or name for terminfo name).
486
487 o RGB for the ncurses direct-color extension.
488 Only a terminfo name is provided, since termcap
489 applications cannot use this information.
490
491 xterm responds with
492 DCS 1 + r Pt ST for valid requests, adding to Pt an = , and
493 the value of the corresponding string that xterm would send,
494 or
495 DCS 0 + r ST for invalid requests.
496 The strings are encoded in hexadecimal (2 digits per
497 character). If more than one name is given, xterm replies
498 with each name/value pair in the same response. An invalid
499 name (one not found in xterm's tables) ends processing of the
500 list of names.
501
502
503 Functions using CSI , ordered by the final character(s)
504
505 CSI Ps @ Insert Ps (Blank) Character(s) (default = 1) (ICH).
506
507 CSI Ps SP @
508 Shift left Ps columns(s) (default = 1) (SL), ECMA-48.
509
510 CSI Ps A Cursor Up Ps Times (default = 1) (CUU).
511
512 CSI Ps SP A
513 Shift right Ps columns(s) (default = 1) (SR), ECMA-48.
514
515 CSI Ps B Cursor Down Ps Times (default = 1) (CUD).
516
517 CSI Ps C Cursor Forward Ps Times (default = 1) (CUF).
518
519 CSI Ps D Cursor Backward Ps Times (default = 1) (CUB).
520
521 CSI Ps E Cursor Next Line Ps Times (default = 1) (CNL).
522
523 CSI Ps F Cursor Preceding Line Ps Times (default = 1) (CPL).
524
525 CSI Ps G Cursor Character Absolute [column] (default = [row,1]) (CHA).
526
527 CSI Ps ; Ps H
528 Cursor Position [row;column] (default = [1,1]) (CUP).
529
530 CSI Ps I Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).
531
532 CSI Ps J Erase in Display (ED), VT100.
533 Ps = 0 -> Erase Below (default).
534 Ps = 1 -> Erase Above.
535 Ps = 2 -> Erase All.
536 Ps = 3 -> Erase Saved Lines, xterm.
537
538 CSI ? Ps J
539 Erase in Display (DECSED), VT220.
540 Ps = 0 -> Selective Erase Below (default).
541 Ps = 1 -> Selective Erase Above.
542 Ps = 2 -> Selective Erase All.
543 Ps = 3 -> Selective Erase Saved Lines, xterm.
544
545 CSI Ps K Erase in Line (EL), VT100.
546 Ps = 0 -> Erase to Right (default).
547 Ps = 1 -> Erase to Left.
548 Ps = 2 -> Erase All.
549
550 CSI ? Ps K
551 Erase in Line (DECSEL), VT220.
552 Ps = 0 -> Selective Erase to Right (default).
553 Ps = 1 -> Selective Erase to Left.
554 Ps = 2 -> Selective Erase All.
555
556 CSI Ps L Insert Ps Line(s) (default = 1) (IL).
557
558 CSI Ps M Delete Ps Line(s) (default = 1) (DL).
559
560 CSI Ps P Delete Ps Character(s) (default = 1) (DCH).
561
562 CSI # P
563 CSI Pm # P
564 Push current dynamic- and ANSI-palette colors onto stack
565 (XTPUSHCOLORS), xterm. Parameters (integers in the range 1
566 through 10, since the default 0 will push) may be used to
567 store the palette into the stack without pushing.
568
569 CSI # Q
570 CSI Pm # Q
571 Pop stack to set dynamic- and ANSI-palette colors
572 (XTPOPCOLORS), xterm. Parameters (integers in the range 1
573 through 10, since the default 0 will pop) may be used to
574 restore the palette from the stack without popping.
575
576 CSI # R Report the current entry on the palette stack, and the number
577 of palettes stored on the stack, using the same form as
578 XTPOPCOLOR (default = 0) (XTREPORTCOLORS), xterm.
579
580 CSI Ps S Scroll up Ps lines (default = 1) (SU), VT420, ECMA-48.
581
582 CSI ? Pi ; Pa ; Pv S
583 Set or request graphics attribute (XTSMGRAPHICS), xterm. If
584 configured to support either Sixel Graphics or ReGIS Graphics,
585 xterm accepts a three-parameter control sequence, where Pi, Pa
586 and Pv are the item, action and value:
587
588 Pi = 1 -> item is number of color registers.
589 Pi = 2 -> item is Sixel graphics geometry (in pixels).
590 Pi = 3 -> item is ReGIS graphics geometry (in pixels).
591
592 Pa = 1 -> read attribute.
593 Pa = 2 -> reset to default.
594 Pa = 3 -> set to value in Pv.
595 Pa = 4 -> read the maximum allowed value.
596
597 Pv is ignored by xterm except when setting (Pa == 3 ).
598 Pv = n <- A single integer is used for color registers.
599 Pv = width ; height <- Two integers for graphics geometry.
600
601 xterm replies with a control sequence of the same form:
602
603 CSI ? Pi ; Ps ; Pv S
604
605 where Ps is the status:
606 Ps = 0 <- success.
607 Ps = 1 <- error in Pi.
608 Ps = 2 <- error in Pa.
609 Ps = 3 <- failure.
610
611 On success, Pv represents the value read or set.
612
613 Notes:
614 o The current implementation allows reading the graphics
615 sizes, but disallows modifying those sizes because that is
616 done once, using resource-values.
617 o Graphics geometry is not necessarily the same as "window
618 size" (see the dtterm window manipulation extensions).
619 XTerm limits the maximum graphics geometry according to
620 the maxGraphicSize resource.
621 The maxGraphicSize resource can be either an explicit
622 heightxwidth (default: 1000x1000 as of version 328) or the
623 word "auto" (telling XTerm to use limits the decGraphicsID
624 or decTerminalID resource to determine the limits).
625 o XTerm uses the minimum of the window size and the graphic
626 size to obtain the maximum geometry.
627 o While resizing a window will always change the current
628 graphics geometry, the reverse is not true. Setting
629 graphics geometry does not affect the window size.
630 o If xterm is able to support graphics (compile-time), but
631 is not configured (runtime) for graphics, these responses
632 will indicate a failure. Other implementations which do
633 not use the maximum graphics dimensions but are configured
634 for graphics should report zeroes for the maximum geometry
635 rather than a failure.
636
637 CSI Ps T Scroll down Ps lines (default = 1) (SD), VT420.
638
639 CSI Ps ; Ps ; Ps ; Ps ; Ps T
640 Initiate highlight mouse tracking (XTHIMOUSE), xterm.
641 Parameters are [func;startx;starty;firstrow;lastrow]. See the
642 section Mouse Tracking.
643
644 CSI > Pm T
645 Reset title mode features to default value (XTRMTITLE), xterm.
646 Normally, "reset" disables the feature. It is possible to
647 disable the ability to reset features by compiling a different
648 default for the title modes into xterm.
649
650 Ps = 0 -> Do not set window/icon labels using hexadecimal.
651 Ps = 1 -> Do not query window/icon labels using
652 hexadecimal.
653 Ps = 2 -> Do not set window/icon labels using UTF-8.
654 Ps = 3 -> Do not query window/icon labels using UTF-8.
655
656 (See discussion of Title Modes).
657
658 CSI Ps X Erase Ps Character(s) (default = 1) (ECH).
659
660 CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).
661
662 CSI Ps ^ Scroll down Ps lines (default = 1) (SD), ECMA-48.
663 This was a publication error in the original ECMA-48 5th
664 edition (1991) corrected in 2003.
665
666 CSI Ps ` Character Position Absolute [column] (default = [row,1])
667 (HPA).
668
669 CSI Ps a Character Position Relative [columns] (default = [row,col+1])
670 (HPR).
671
672 CSI Ps b Repeat the preceding graphic character Ps times (REP).
673
674 CSI Ps c Send Device Attributes (Primary DA).
675 Ps = 0 or omitted -> request attributes from terminal. The
676 response depends on the decTerminalID resource setting.
677 -> CSI ? 1 ; 2 c ("VT100 with Advanced Video Option")
678 -> CSI ? 1 ; 0 c ("VT101 with No Options")
679 -> CSI ? 4 ; 6 c ("VT132 with Advanced Video and Graphics")
680 -> CSI ? 6 c ("VT102")
681 -> CSI ? 7 c ("VT131")
682 -> CSI ? 1 2 ; Ps c ("VT125")
683 -> CSI ? 6 2 ; Ps c ("VT220")
684 -> CSI ? 6 3 ; Ps c ("VT320")
685 -> CSI ? 6 4 ; Ps c ("VT420")
686
687 The VT100-style response parameters do not mean anything by
688 themselves. VT220 (and higher) parameters do, telling the
689 host what features the terminal supports:
690 Ps = 1 -> 132-columns.
691 Ps = 2 -> Printer.
692 Ps = 3 -> ReGIS graphics.
693 Ps = 4 -> Sixel graphics.
694 Ps = 6 -> Selective erase.
695 Ps = 8 -> User-defined keys.
696 Ps = 9 -> National Replacement Character sets.
697 Ps = 1 5 -> Technical characters.
698 Ps = 1 6 -> Locator port.
699 Ps = 1 7 -> Terminal state interrogation.
700 Ps = 1 8 -> User windows.
701 Ps = 2 1 -> Horizontal scrolling.
702 Ps = 2 2 -> ANSI color, e.g., VT525.
703 Ps = 2 8 -> Rectangular editing.
704 Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).
705
706 XTerm supports part of the User windows feature, providing a
707 single page (which corresponds to its visible window). Rather
708 than resizing the font to change the number of lines/columns
709 in a fixed-size display, xterm uses the window extension
710 controls (DECSNLS, DECSCPP, DECSLPP) to adjust its visible
711 window's size. The "cursor coupling" controls (DECHCCM,
712 DECPCCM, DECVCCM) are ignored.
713
714 CSI = Ps c
715 Send Device Attributes (Tertiary DA).
716 Ps = 0 -> report Terminal Unit ID (default), VT400. XTerm
717 uses zeros for the site code and serial number in its DECRPTUI
718 response.
719
720 CSI > Ps c
721 Send Device Attributes (Secondary DA).
722 Ps = 0 or omitted -> request the terminal's identification
723 code. The response depends on the decTerminalID resource
724 setting. It should apply only to VT220 and up, but xterm
725 extends this to VT100.
726 -> CSI > Pp ; Pv ; Pc c
727 where Pp denotes the terminal type
728 Pp = 0 -> "VT100".
729 Pp = 1 -> "VT220".
730 Pp = 2 -> "VT240" or "VT241".
731 Pp = 1 8 -> "VT330".
732 Pp = 1 9 -> "VT340".
733 Pp = 2 4 -> "VT320".
734 Pp = 3 2 -> "VT382".
735 Pp = 4 1 -> "VT420".
736 Pp = 6 1 -> "VT510".
737 Pp = 6 4 -> "VT520".
738 Pp = 6 5 -> "VT525".
739
740 and Pv is the firmware version (for xterm, this was originally
741 the XFree86 patch number, starting with 95). In a DEC
742 terminal, Pc indicates the ROM cartridge registration number
743 and is always zero.
744
745 CSI Ps d Line Position Absolute [row] (default = [1,column]) (VPA).
746
747 CSI Ps e Line Position Relative [rows] (default = [row+1,column])
748 (VPR).
749
750 CSI Ps ; Ps f
751 Horizontal and Vertical Position [row;column] (default =
752 [1,1]) (HVP).
753
754 CSI Ps g Tab Clear (TBC). ECMA-48 defines additional codes, but the
755 VT100 user manual notes that it ignores other codes. DEC's
756 later terminals (and xterm) do the same, for compatibility.
757 Ps = 0 -> Clear Current Column (default).
758 Ps = 3 -> Clear All.
759
760 CSI Pm h Set Mode (SM).
761 Ps = 2 -> Keyboard Action Mode (KAM).
762 Ps = 4 -> Insert Mode (IRM).
763 Ps = 1 2 -> Send/receive (SRM).
764 Ps = 2 0 -> Automatic Newline (LNM).
765
766 CSI ? Pm h
767 DEC Private Mode Set (DECSET).
768 Ps = 1 -> Application Cursor Keys (DECCKM), VT100.
769 Ps = 2 -> Designate USASCII for character sets G0-G3
770 (DECANM), VT100, and set VT100 mode.
771 Ps = 3 -> 132 Column Mode (DECCOLM), VT100.
772 Ps = 4 -> Smooth (Slow) Scroll (DECSCLM), VT100.
773 Ps = 5 -> Reverse Video (DECSCNM), VT100.
774 Ps = 6 -> Origin Mode (DECOM), VT100.
775 Ps = 7 -> Auto-Wrap Mode (DECAWM), VT100.
776 Ps = 8 -> Auto-Repeat Keys (DECARM), VT100.
777 Ps = 9 -> Send Mouse X & Y on button press. See the
778 section Mouse Tracking. This is the X10 xterm mouse protocol.
779 Ps = 1 0 -> Show toolbar (rxvt).
780 Ps = 1 2 -> Start blinking cursor (AT&T 610).
781 Ps = 1 3 -> Start blinking cursor (set only via resource or
782 menu).
783 Ps = 1 4 -> Enable XOR of blinking cursor control sequence
784 and menu.
785 Ps = 1 8 -> Print Form Feed (DECPFF), VT220.
786 Ps = 1 9 -> Set print extent to full screen (DECPEX),
787 VT220.
788 Ps = 2 5 -> Show cursor (DECTCEM), VT220.
789 Ps = 3 0 -> Show scrollbar (rxvt).
790 Ps = 3 5 -> Enable font-shifting functions (rxvt).
791 Ps = 3 8 -> Enter Tektronix mode (DECTEK), VT240, xterm.
792 Ps = 4 0 -> Allow 80 -> 132 mode, xterm.
793 Ps = 4 1 -> more(1) fix (see curses resource).
794 Ps = 4 2 -> Enable National Replacement Character sets
795 (DECNRCM), VT220.
796 Ps = 4 3 -> Enable Graphics Expanded Print Mode (DECGEPM).
797 Ps = 4 4 -> Turn on margin bell, xterm.
798 Ps = 4 4 -> Enable Graphics Print Color Mode (DECGPCM).
799 Ps = 4 5 -> Reverse-wraparound mode, xterm.
800 Ps = 4 5 -> Enable Graphics Print ColorSpace (DECGPCS).
801 Ps = 4 6 -> Start logging, xterm. This is normally
802 disabled by a compile-time option.
803 Ps = 4 7 -> Use Alternate Screen Buffer, xterm. This may
804 be disabled by the titeInhibit resource.
805 Ps = 4 7 -> Enable Graphics Rotated Print Mode (DECGRPM).
806 Ps = 6 6 -> Application keypad mode (DECNKM), VT320.
807 Ps = 6 7 -> Backarrow key sends backspace (DECBKM), VT340,
808 VT420. This sets the backarrowKey resource to "true".
809 Ps = 6 9 -> Enable left and right margin mode (DECLRMM),
810 VT420 and up.
811 Ps = 8 0 -> Enable Sixel Display Mode (DECSDM), VT330,
812 VT340, VT382.
813 Ps = 9 5 -> Do not clear screen when DECCOLM is set/reset
814 (DECNCSM), VT510 and up.
815 Ps = 1 0 0 0 -> Send Mouse X & Y on button press and
816 release. See the section Mouse Tracking. This is the X11
817 xterm mouse protocol.
818 Ps = 1 0 0 1 -> Use Hilite Mouse Tracking, xterm.
819 Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking, xterm. See
820 the section Button-event tracking.
821 Ps = 1 0 0 3 -> Use All Motion Mouse Tracking, xterm. See
822 the section Any-event tracking.
823 Ps = 1 0 0 4 -> Send FocusIn/FocusOut events, xterm.
824 Ps = 1 0 0 5 -> Enable UTF-8 Mouse Mode, xterm.
825 Ps = 1 0 0 6 -> Enable SGR Mouse Mode, xterm.
826 Ps = 1 0 0 7 -> Enable Alternate Scroll Mode, xterm. This
827 corresponds to the alternateScroll resource.
828 Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt).
829 This sets the scrollTtyOutput resource to "true".
830 Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). This
831 sets the scrollKey resource to "true".
832 Ps = 1 0 1 5 -> Enable urxvt Mouse Mode.
833 Ps = 1 0 1 6 -> Enable SGR Mouse PixelMode, xterm.
834 Ps = 1 0 3 4 -> Interpret "meta" key, xterm. This sets the
835 eighth bit of keyboard input (and enables the eightBitInput
836 resource).
837 Ps = 1 0 3 5 -> Enable special modifiers for Alt and
838 NumLock keys, xterm. This enables the numLock resource.
839 Ps = 1 0 3 6 -> Send ESC when Meta modifies a key, xterm.
840 This enables the metaSendsEscape resource.
841 Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete
842 key, xterm.
843 Ps = 1 0 3 9 -> Send ESC when Alt modifies a key, xterm.
844 This enables the altSendsEscape resource, xterm.
845 Ps = 1 0 4 0 -> Keep selection even if not highlighted,
846 xterm. This enables the keepSelection resource.
847 Ps = 1 0 4 1 -> Use the CLIPBOARD selection, xterm. This
848 enables the selectToClipboard resource.
849 Ps = 1 0 4 2 -> Enable Urgency window manager hint when
850 Control-G is received, xterm. This enables the bellIsUrgent
851 resource.
852 Ps = 1 0 4 3 -> Enable raising of the window when Control-G
853 is received, xterm. This enables the popOnBell resource.
854 Ps = 1 0 4 4 -> Reuse the most recent data copied to
855 CLIPBOARD, xterm. This enables the keepClipboard resource.
856 Ps = 1 0 4 6 -> Enable switching to/from Alternate Screen
857 Buffer, xterm. This works for terminfo-based systems,
858 updating the titeInhibit resource.
859 Ps = 1 0 4 7 -> Use Alternate Screen Buffer, xterm. This
860 may be disabled by the titeInhibit resource.
861 Ps = 1 0 4 8 -> Save cursor as in DECSC, xterm. This may
862 be disabled by the titeInhibit resource.
863 Ps = 1 0 4 9 -> Save cursor as in DECSC, xterm. After
864 saving the cursor, switch to the Alternate Screen Buffer,
865 clearing it first. This may be disabled by the titeInhibit
866 resource. This control combines the effects of the 1 0 4 7
867 and 1 0 4 8 modes. Use this with terminfo-based applications
868 rather than the 4 7 mode.
869 Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode,
870 xterm.
871 Ps = 1 0 5 1 -> Set Sun function-key mode, xterm.
872 Ps = 1 0 5 2 -> Set HP function-key mode, xterm.
873 Ps = 1 0 5 3 -> Set SCO function-key mode, xterm.
874 Ps = 1 0 6 0 -> Set legacy keyboard emulation, i.e, X11R6,
875 xterm.
876 Ps = 1 0 6 1 -> Set VT220 keyboard emulation, xterm.
877 Ps = 2 0 0 1 -> Enable readline mouse button-1, xterm.
878 Ps = 2 0 0 2 -> Enable readline mouse button-2, xterm.
879 Ps = 2 0 0 3 -> Enable readline mouse button-3, xterm.
880 Ps = 2 0 0 4 -> Set bracketed paste mode, xterm.
881 Ps = 2 0 0 5 -> Enable readline character-quoting, xterm.
882 Ps = 2 0 0 6 -> Enable readline newline pasting, xterm.
883
884 CSI Ps i Media Copy (MC).
885 Ps = 0 -> Print screen (default).
886 Ps = 4 -> Turn off printer controller mode.
887 Ps = 5 -> Turn on printer controller mode.
888 Ps = 1 0 -> HTML screen dump, xterm.
889 Ps = 1 1 -> SVG screen dump, xterm.
890
891 CSI ? Ps i
892 Media Copy (MC), DEC-specific.
893 Ps = 1 -> Print line containing cursor.
894 Ps = 4 -> Turn off autoprint mode.
895 Ps = 5 -> Turn on autoprint mode.
896 Ps = 1 0 -> Print composed display, ignores DECPEX.
897 Ps = 1 1 -> Print all pages.
898
899 CSI Pm l Reset Mode (RM).
900 Ps = 2 -> Keyboard Action Mode (KAM).
901 Ps = 4 -> Replace Mode (IRM).
902 Ps = 1 2 -> Send/receive (SRM).
903 Ps = 2 0 -> Normal Linefeed (LNM).
904
905 CSI ? Pm l
906 DEC Private Mode Reset (DECRST).
907 Ps = 1 -> Normal Cursor Keys (DECCKM), VT100.
908 Ps = 2 -> Designate VT52 mode (DECANM), VT100.
909 Ps = 3 -> 80 Column Mode (DECCOLM), VT100.
910 Ps = 4 -> Jump (Fast) Scroll (DECSCLM), VT100.
911 Ps = 5 -> Normal Video (DECSCNM), VT100.
912 Ps = 6 -> Normal Cursor Mode (DECOM), VT100.
913 Ps = 7 -> No Auto-Wrap Mode (DECAWM), VT100.
914 Ps = 8 -> No Auto-Repeat Keys (DECARM), VT100.
915 Ps = 9 -> Don't send Mouse X & Y on button press, xterm.
916 Ps = 1 0 -> Hide toolbar (rxvt).
917 Ps = 1 2 -> Stop blinking cursor (AT&T 610).
918 Ps = 1 3 -> Disable blinking cursor (reset only via
919 resource or menu).
920 Ps = 1 4 -> Disable XOR of blinking cursor control sequence
921 and menu.
922 Ps = 1 8 -> Don't Print Form Feed (DECPFF), VT220.
923 Ps = 1 9 -> Limit print to scrolling region (DECPEX),
924 VT220.
925 Ps = 2 5 -> Hide cursor (DECTCEM), VT220.
926 Ps = 3 0 -> Don't show scrollbar (rxvt).
927 Ps = 3 5 -> Disable font-shifting functions (rxvt).
928 Ps = 4 0 -> Disallow 80 -> 132 mode, xterm.
929 Ps = 4 1 -> No more(1) fix (see curses resource).
930 Ps = 4 2 -> Disable National Replacement Character sets
931 (DECNRCM), VT220.
932 Ps = 4 3 -> Disable Graphics Expanded Print Mode (DECGEPM).
933 Ps = 4 4 -> Turn off margin bell, xterm.
934 Ps = 4 4 -> Disable Graphics Print Color Mode (DECGPCM).
935 Ps = 4 5 -> No Reverse-wraparound mode, xterm.
936 Ps = 4 5 -> Disable Graphics Print ColorSpace (DECGPCS).
937 Ps = 4 6 -> Stop logging, xterm. This is normally disabled
938 by a compile-time option.
939 Ps = 4 7 -> Use Normal Screen Buffer, xterm.
940 Ps = 4 7 -> Disable Graphics Rotated Print Mode (DECGRPM).
941 Ps = 6 6 -> Numeric keypad mode (DECNKM), VT320.
942 Ps = 6 7 -> Backarrow key sends delete (DECBKM), VT340,
943 VT420. This sets the backarrowKey resource to "false".
944 Ps = 6 9 -> Disable left and right margin mode (DECLRMM),
945 VT420 and up.
946 Ps = 8 0 -> Disable Sixel Display Mode (DECSDM), VT330,
947 VT340, VT382. Turns on "Sixel Scrolling". See the section
948 Sixel Graphics and mode 8 4 5 2 .
949 Ps = 9 5 -> Clear screen when DECCOLM is set/reset
950 (DECNCSM), VT510 and up.
951 Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and
952 release. See the section Mouse Tracking.
953 Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking, xterm.
954 Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking,
955 xterm. See the section Button-event tracking.
956 Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking, xterm.
957 See the section Any-event tracking.
958 Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events, xterm.
959 Ps = 1 0 0 5 -> Disable UTF-8 Mouse Mode, xterm.
960 Ps = 1 0 0 6 -> Disable SGR Mouse Mode, xterm.
961 Ps = 1 0 0 7 -> Disable Alternate Scroll Mode, xterm. This
962 corresponds to the alternateScroll resource.
963 Ps = 1 0 1 0 -> Don't scroll to bottom on tty output
964 (rxvt). This sets the scrollTtyOutput resource to "false".
965 Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt).
966 This sets the scrollKey resource to "false".
967 Ps = 1 0 1 5 -> Disable urxvt Mouse Mode.
968 Ps = 1 0 1 6 -> Disable SGR Mouse Pixel-Mode, xterm.
969 Ps = 1 0 3 4 -> Don't interpret "meta" key, xterm. This
970 disables the eightBitInput resource.
971 Ps = 1 0 3 5 -> Disable special modifiers for Alt and
972 NumLock keys, xterm. This disables the numLock resource.
973 Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key,
974 xterm. This disables the metaSendsEscape resource.
975 Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad
976 Delete key, xterm.
977 Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key,
978 xterm. This disables the altSendsEscape resource.
979 Ps = 1 0 4 0 -> Do not keep selection when not highlighted,
980 xterm. This disables the keepSelection resource.
981 Ps = 1 0 4 1 -> Use the PRIMARY selection, xterm. This
982 disables the selectToClipboard resource.
983 Ps = 1 0 4 2 -> Disable Urgency window manager hint when
984 Control-G is received, xterm. This disables the bellIsUrgent
985 resource.
986 Ps = 1 0 4 3 -> Disable raising of the window when Control-
987 G is received, xterm. This disables the popOnBell resource.
988 Ps = 1 0 4 6 -> Disable switching to/from Alternate Screen
989 Buffer, xterm. This works for terminfo-based systems,
990 updating the titeInhibit resource. If currently using the
991 Alternate Screen Buffer, xterm switches to the Normal Screen
992 Buffer.
993 Ps = 1 0 4 7 -> Use Normal Screen Buffer, xterm. Clear the
994 screen first if in the Alternate Screen Buffer. This may be
995 disabled by the titeInhibit resource.
996 Ps = 1 0 4 8 -> Restore cursor as in DECRC, xterm. This
997 may be disabled by the titeInhibit resource.
998 Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor
999 as in DECRC, xterm. This may be disabled by the titeInhibit
1000 resource. This combines the effects of the 1 0 4 7 and 1 0 4
1001 8 modes. Use this with terminfo-based applications rather
1002 than the 4 7 mode.
1003 Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode,
1004 xterm.
1005 Ps = 1 0 5 1 -> Reset Sun function-key mode, xterm.
1006 Ps = 1 0 5 2 -> Reset HP function-key mode, xterm.
1007 Ps = 1 0 5 3 -> Reset SCO function-key mode, xterm.
1008 Ps = 1 0 6 0 -> Reset legacy keyboard emulation, i.e,
1009 X11R6, xterm.
1010 Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style,
1011 xterm.
1012 Ps = 2 0 0 1 -> Disable readline mouse button-1, xterm.
1013 Ps = 2 0 0 2 -> Disable readline mouse button-2, xterm.
1014 Ps = 2 0 0 3 -> Disable readline mouse button-3, xterm.
1015 Ps = 2 0 0 4 -> Reset bracketed paste mode, xterm.
1016 Ps = 2 0 0 5 -> Disable readline character-quoting, xterm.
1017 Ps = 2 0 0 6 -> Disable readline newline pasting, xterm.
1018
1019 CSI Pm m Character Attributes (SGR).
1020 Ps = 0 -> Normal (default), VT100.
1021 Ps = 1 -> Bold, VT100.
1022 Ps = 2 -> Faint, decreased intensity, ECMA-48 2nd.
1023 Ps = 3 -> Italicized, ECMA-48 2nd.
1024 Ps = 4 -> Underlined, VT100.
1025 Ps = 5 -> Blink, VT100.
1026 This appears as Bold in X11R6 xterm.
1027 Ps = 7 -> Inverse, VT100.
1028 Ps = 8 -> Invisible, i.e., hidden, ECMA-48 2nd, VT300.
1029 Ps = 9 -> Crossed-out characters, ECMA-48 3rd.
1030 Ps = 2 1 -> Doubly-underlined, ECMA-48 3rd.
1031 Ps = 2 2 -> Normal (neither bold nor faint), ECMA-48 3rd.
1032 Ps = 2 3 -> Not italicized, ECMA-48 3rd.
1033 Ps = 2 4 -> Not underlined, ECMA-48 3rd.
1034 Ps = 2 5 -> Steady (not blinking), ECMA-48 3rd.
1035 Ps = 2 7 -> Positive (not inverse), ECMA-48 3rd.
1036 Ps = 2 8 -> Visible, i.e., not hidden, ECMA-48 3rd, VT300.
1037 Ps = 2 9 -> Not crossed-out, ECMA-48 3rd.
1038 Ps = 3 0 -> Set foreground color to Black.
1039 Ps = 3 1 -> Set foreground color to Red.
1040 Ps = 3 2 -> Set foreground color to Green.
1041 Ps = 3 3 -> Set foreground color to Yellow.
1042 Ps = 3 4 -> Set foreground color to Blue.
1043 Ps = 3 5 -> Set foreground color to Magenta.
1044 Ps = 3 6 -> Set foreground color to Cyan.
1045 Ps = 3 7 -> Set foreground color to White.
1046 Ps = 3 9 -> Set foreground color to default, ECMA-48 3rd.
1047 Ps = 4 0 -> Set background color to Black.
1048 Ps = 4 1 -> Set background color to Red.
1049 Ps = 4 2 -> Set background color to Green.
1050 Ps = 4 3 -> Set background color to Yellow.
1051 Ps = 4 4 -> Set background color to Blue.
1052 Ps = 4 5 -> Set background color to Magenta.
1053 Ps = 4 6 -> Set background color to Cyan.
1054 Ps = 4 7 -> Set background color to White.
1055 Ps = 4 9 -> Set background color to default, ECMA-48 3rd.
1056
1057 Some of the above note the edition of ECMA-48 which first
1058 describes a feature. In its successive editions from 1979 to
1059 1991 (2nd 1979, 3rd 1984, 4th 1986, and 5th 1991), ECMA-48
1060 listed codes through 6 5 (skipping several toward the end of
1061 the range). Most of the ECMA-48 codes not implemented in
1062 xterm were never implemented in a hardware terminal. Several
1063 (such as 3 9 and 4 9 ) are either noted in ECMA-48 as
1064 implementation defined, or described in vague terms.
1065
1066 The successive editions of ECMA-48 give little attention to
1067 changes from one edition to the next, except to comment on
1068 features which have become obsolete. ECMA-48 1st (1976) is
1069 unavailable; there is no reliable source of information which
1070 states whether "ANSI" color was defined in that edition, or
1071 later (1979). The VT100 (1978) implemented the most commonly
1072 used non-color video attributes which are given in the 2nd
1073 edition.
1074
1075 While 8-color support is described in ECMA-48 2nd edition, the
1076 VT500 series (introduced in 1993) were the first DEC terminals
1077 implementing "ANSI" color. The DEC terminal's use of color is
1078 known to differ from xterm; useful documentation on this
1079 series became available too late to influence xterm.
1080
1081 If 16-color support is compiled, the following aixterm
1082 controls apply. Assume that xterm's resources are set so that
1083 the ISO color codes are the first 8 of a set of 16. Then the
1084 aixterm colors are the bright versions of the ISO colors:
1085
1086 Ps = 9 0 -> Set foreground color to Black.
1087 Ps = 9 1 -> Set foreground color to Red.
1088 Ps = 9 2 -> Set foreground color to Green.
1089 Ps = 9 3 -> Set foreground color to Yellow.
1090 Ps = 9 4 -> Set foreground color to Blue.
1091 Ps = 9 5 -> Set foreground color to Magenta.
1092 Ps = 9 6 -> Set foreground color to Cyan.
1093 Ps = 9 7 -> Set foreground color to White.
1094 Ps = 1 0 0 -> Set background color to Black.
1095 Ps = 1 0 1 -> Set background color to Red.
1096 Ps = 1 0 2 -> Set background color to Green.
1097 Ps = 1 0 3 -> Set background color to Yellow.
1098 Ps = 1 0 4 -> Set background color to Blue.
1099 Ps = 1 0 5 -> Set background color to Magenta.
1100 Ps = 1 0 6 -> Set background color to Cyan.
1101 Ps = 1 0 7 -> Set background color to White.
1102
1103 If xterm is compiled with the 16-color support disabled, it
1104 supports the following, from rxvt:
1105 Ps = 1 0 0 -> Set foreground and background color to
1106 default.
1107
1108 XTerm maintains a color palette whose entries are identified
1109 by an index beginning with zero. If 88- or 256-color support
1110 is compiled, the following apply:
1111 o All parameters are decimal integers.
1112 o RGB values range from zero (0) to 255.
1113 o The 88- and 256-color support uses subparameters described
1114 in ISO-8613-6 for indexed color. ISO-8613-6 also mentions
1115 direct color, using a similar scheme. xterm supports
1116 that, too.
1117 o xterm allows either colons (standard) or semicolons
1118 (legacy) to separate the subparameters (but after the
1119 first colon, colons must be used).
1120
1121 The indexed- and direct-color features are summarized in the
1122 FAQ, which explains why semicolon is accepted as a
1123 subparameter delimiter:
1124
1125 Can I set a color by its number?
1126
1127
1128 These ISO-8613-6 controls (marked in ECMA-48 5th edition as
1129 "reserved for future standardization") are supported by xterm:
1130 Ps = 3 8 : 2 : Pi : Pr : Pg : Pb -> Set foreground color
1131 using RGB values. If xterm is not compiled with direct-color
1132 support, it uses the closest match in its palette for the
1133 given RGB Pr/Pg/Pb. The color space identifier Pi is ignored.
1134 Ps = 3 8 : 5 : Ps -> Set foreground color to Ps, using
1135 indexed color.
1136 Ps = 4 8 : 2 : Pi : Pr : Pg : Pb -> Set background color
1137 using RGB values. If xterm is not compiled with direct-color
1138 support, it uses the closest match in its palette for the
1139 given RGB Pr/Pg/Pb. The color space identifier Pi is ignored.
1140 Ps = 4 8 : 5 : Ps -> Set background color to Ps, using
1141 indexed color.
1142
1143 This variation on ISO-8613-6 is supported for compatibility
1144 with KDE konsole:
1145 Ps = 3 8 ; 2 ; Pr ; Pg ; Pb -> Set foreground color using
1146 RGB values. If xterm is not compiled with direct-color
1147 support, it uses the closest match in its palette for the
1148 given RGB Pr/Pg/Pb.
1149 Ps = 4 8 ; 2 ; Pr ; Pg ; Pb -> Set background color using
1150 RGB values. If xterm is not compiled with direct-color
1151 support, it uses the closest match in its palette for the
1152 given RGB Pr/Pg/Pb.
1153
1154 In each case, if xterm is compiled with direct-color support,
1155 and the resource directColor is true, then rather than
1156 choosing the closest match, xterm asks the X server to
1157 directly render a given color.
1158
1159 CSI > Pp ; Pv m
1160 CSI > Pp m
1161 Set/reset key modifier options (XTMODKEYS), xterm. Set or
1162 reset resource-values used by xterm to decide whether to
1163 construct escape sequences holding information about the
1164 modifiers pressed with a given key.
1165
1166 The first parameter Pp identifies the resource to set/reset.
1167 The second parameter Pv is the value to assign to the
1168 resource.
1169
1170 If the second parameter is omitted, the resource is reset to
1171 its initial value. Values 3 and 5 are reserved for keypad-
1172 keys and string-keys.
1173
1174 Pp = 0 -> modifyKeyboard.
1175 Pp = 1 -> modifyCursorKeys.
1176 Pp = 2 -> modifyFunctionKeys.
1177 Pp = 4 -> modifyOtherKeys.
1178
1179 If no parameters are given, all resources are reset to their
1180 initial values.
1181
1182 CSI ? Pp m
1183 Query key modifier options (XTQMODKEYS), xterm.
1184
1185 The parameter Pp identifies the resource to query.
1186
1187 Pp = 0 -> modifyKeyboard.
1188 Pp = 1 -> modifyCursorKeys.
1189 Pp = 2 -> modifyFunctionKeys.
1190 Pp = 4 -> modifyOtherKeys.
1191
1192 XTerm's response can be used to restore this state, because it
1193 is formatted as an XTMODKEYS control, i.e.,
1194
1195 CSI > Pp m
1196
1197 where
1198
1199 Pp = 0 -> modifyKeyboard.
1200 Pp = 1 -> modifyCursorKeys.
1201 Pp = 2 -> modifyFunctionKeys.
1202 Pp = 4 -> modifyOtherKeys.
1203
1204 CSI Ps n Device Status Report (DSR).
1205 Ps = 5 -> Status Report.
1206 Result ("OK") is CSI 0 n
1207 Ps = 6 -> Report Cursor Position (CPR) [row;column].
1208 Result is CSI r ; c R
1209
1210 Note: it is possible for this sequence to be sent by a
1211 function key. For example, with the default keyboard
1212 configuration the shifted F1 key may send (with shift-,
1213 control-, alt-modifiers)
1214
1215 CSI 1 ; 2 R , or
1216 CSI 1 ; 5 R , or
1217 CSI 1 ; 6 R , etc.
1218
1219 The second parameter encodes the modifiers; values range from
1220 2 to 16. See the section PC-Style Function Keys for the
1221 codes. The modifyFunctionKeys and modifyKeyboard resources
1222 can change the form of the string sent from the modified F1
1223 key.
1224
1225 CSI > Ps n
1226 Disable key modifier options, xterm. These modifiers may be
1227 enabled via the CSI > Pm m sequence. This control sequence
1228 corresponds to a resource value of "-1", which cannot be set
1229 with the other sequence.
1230
1231 The parameter identifies the resource to be disabled:
1232
1233 Ps = 0 -> modifyKeyboard.
1234 Ps = 1 -> modifyCursorKeys.
1235 Ps = 2 -> modifyFunctionKeys.
1236 Ps = 4 -> modifyOtherKeys.
1237
1238 If the parameter is omitted, modifyFunctionKeys is disabled.
1239 When modifyFunctionKeys is disabled, xterm uses the modifier
1240 keys to make an extended sequence of function keys rather than
1241 adding a parameter to each function key to denote the
1242 modifiers.
1243
1244 CSI ? Ps n
1245 Device Status Report (DSR, DEC-specific).
1246 Ps = 6 -> Report Cursor Position (DECXCPR). The response
1247 [row;column] is returned as
1248 CSI ? r ; c R
1249 (assumes the default page, i.e., "1").
1250 Ps = 1 5 -> Report Printer status. The response is
1251 CSI ? 1 0 n (ready). or
1252 CSI ? 1 1 n (not ready).
1253 Ps = 2 5 -> Report UDK status. The response is
1254 CSI ? 2 0 n (unlocked)
1255 or
1256 CSI ? 2 1 n (locked).
1257 Ps = 2 6 -> Report Keyboard status. The response is
1258 CSI ? 2 7 ; 1 ; 0 ; 0 n (North American).
1259
1260 The last two parameters apply to VT300 & up (keyboard ready)
1261 and VT400 & up (LK01) respectively.
1262
1263 Ps = 5 3 -> Report Locator status. The response is CSI ? 5
1264 3 n Locator available, if compiled-in, or CSI ? 5 0 n No
1265 Locator, if not.
1266 Ps = 5 5 -> Report Locator status. The response is CSI ? 5
1267 3 n Locator available, if compiled-in, or CSI ? 5 0 n No
1268 Locator, if not.
1269 Ps = 5 6 -> Report Locator type. The response is CSI ? 5 7
1270 ; 1 n Mouse, if compiled-in, or CSI ? 5 7 ; 0 n Cannot
1271 identify, if not.
1272 Ps = 6 2 -> Report macro space (DECMSR). The response is
1273 CSI Pn * { .
1274 Ps = 6 3 -> Report memory checksum (DECCKSR), VT420 and up.
1275 The response is DCS Pt ! ~ x x x x ST .
1276 Pt is the request id (from an optional parameter to the
1277 request).
1278 The x's are hexadecimal digits 0-9 and A-F.
1279 Ps = 7 5 -> Report data integrity. The response is CSI ? 7
1280 0 n (ready, no errors).
1281 Ps = 8 5 -> Report multi-session configuration. The
1282 response is CSI ? 8 3 n (not configured for multiple-session
1283 operation).
1284
1285 CSI > Ps p
1286 Set resource value pointerMode (XTSMPOINTER), xterm. This is
1287 used by xterm to decide whether to hide the pointer cursor as
1288 the user types.
1289
1290 Valid values for the parameter:
1291 Ps = 0 -> never hide the pointer.
1292 Ps = 1 -> hide if the mouse tracking mode is not enabled.
1293 Ps = 2 -> always hide the pointer, except when leaving the
1294 window.
1295 Ps = 3 -> always hide the pointer, even if leaving/entering
1296 the window.
1297
1298 If no parameter is given, xterm uses the default, which is 1 .
1299
1300 CSI ! p Soft terminal reset (DECSTR), VT220 and up.
1301
1302 CSI Pl ; Pc " p
1303 Set conformance level (DECSCL), VT220 and up.
1304
1305 The first parameter selects the conformance level. Valid
1306 values are:
1307 Pl = 6 1 -> level 1, e.g., VT100.
1308 Pl = 6 2 -> level 2, e.g., VT200.
1309 Pl = 6 3 -> level 3, e.g., VT300.
1310 Pl = 6 4 -> level 4, e.g., VT400.
1311 Pl = 6 5 -> level 5, e.g., VT500.
1312
1313 The second parameter selects the C1 control transmission mode.
1314 This is an optional parameter, ignored in conformance level 1.
1315 Valid values are:
1316 Pc = 0 -> 8-bit controls.
1317 Pc = 1 -> 7-bit controls (DEC factory default).
1318 Pc = 2 -> 8-bit controls.
1319
1320 The 7-bit and 8-bit control modes can also be set by S7C1T and
1321 S8C1T, but DECSCL is preferred.
1322
1323 CSI Ps $ p
1324 Request ANSI mode (DECRQM). For VT300 and up, reply DECRPM is
1325 CSI Ps; Pm $ y
1326 where Ps is the mode number as in SM/RM, and Pm is the mode
1327 value:
1328 0 - not recognized
1329 1 - set
1330 2 - reset
1331 3 - permanently set
1332 4 - permanently reset
1333
1334 CSI ? Ps $ p
1335 Request DEC private mode (DECRQM). For VT300 and up, reply
1336 DECRPM is
1337 CSI ? Ps; Pm $ y
1338 where Ps is the mode number as in DECSET/DECSET, Pm is the
1339 mode value as in the ANSI DECRQM.
1340 Two private modes are read-only (i.e., 1 3 and 1 4 ),
1341 provided only for reporting their values using this control
1342 sequence. They correspond to the resources cursorBlink and
1343 cursorBlinkXOR.
1344 CSI # p
1345 CSI Pm # p
1346 Push video attributes onto stack (XTPUSHSGR), xterm. This is
1347 an alias for CSI # { , used to work around language
1348 limitations of C#.
1349
1350 CSI > Ps q
1351 Ps = 0 -> Report xterm name and version (XTVERSION). The
1352 response is a DSR sequence identifying the version: DCS > |
1353 text ST
1354
1355 CSI Ps q Load LEDs (DECLL), VT100.
1356 Ps = 0 -> Clear all LEDS (default).
1357 Ps = 1 -> Light Num Lock.
1358 Ps = 2 -> Light Caps Lock.
1359 Ps = 3 -> Light Scroll Lock.
1360 Ps = 2 1 -> Extinguish Num Lock.
1361 Ps = 2 2 -> Extinguish Caps Lock.
1362 Ps = 2 3 -> Extinguish Scroll Lock.
1363
1364 CSI Ps SP q
1365 Set cursor style (DECSCUSR), VT520.
1366 Ps = 0 -> blinking block.
1367 Ps = 1 -> blinking block (default).
1368 Ps = 2 -> steady block.
1369 Ps = 3 -> blinking underline.
1370 Ps = 4 -> steady underline.
1371 Ps = 5 -> blinking bar, xterm.
1372 Ps = 6 -> steady bar, xterm.
1373
1374 CSI Ps " q
1375 Select character protection attribute (DECSCA), VT220. Valid
1376 values for the parameter:
1377 Ps = 0 -> DECSED and DECSEL can erase (default).
1378 Ps = 1 -> DECSED and DECSEL cannot erase.
1379 Ps = 2 -> DECSED and DECSEL can erase.
1380
1381 CSI # q Pop video attributes from stack (XTPOPSGR), xterm. This is an
1382 alias for CSI # } , used to work around language limitations
1383 of C#.
1384
1385 CSI Ps ; Ps r
1386 Set Scrolling Region [top;bottom] (default = full size of
1387 window) (DECSTBM), VT100.
1388
1389 CSI ? Pm r
1390 Restore DEC Private Mode Values (XTRESTORE), xterm. The value
1391 of Ps previously saved is restored. Ps values are the same as
1392 for DECSET.
1393
1394 Like Restore Cursor (DECRC), this uses a one-level cache.
1395 Unlike Restore Cursor, specific settings can be saved and
1396 restored independently. Only those modes listed as parameters
1397 are restored.
1398
1399 CSI Pt ; Pl ; Pb ; Pr ; Pm $ r
1400 Change Attributes in Rectangular Area (DECCARA), VT400 and up.
1401 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1402 Pm denotes the SGR attributes to change: 0, 1, 4, 5, 7.
1403
1404 CSI s Save cursor, available only when DECLRMM is disabled (SCOSC,
1405 also ANSI.SYS).
1406
1407 CSI Pl ; Pr s
1408 Set left and right margins (DECSLRM), VT420 and up. This is
1409 available only when DECLRMM is enabled.
1410
1411 CSI > Ps s
1412 Set/reset shift-escape options (XTSHIFTESCAPE), xterm. This
1413 corresponds to the shiftEscape resource.
1414
1415 Valid values for the parameter:
1416 Ps = 0 -> allow shift-key to override mouse protocol.
1417 Ps = 1 -> conditionally allow shift-key as modifier in
1418 mouse protocol.
1419
1420 These resource values are disallowed in the control sequence:
1421 Ps = 2 -> always allow shift-key as modifier in mouse
1422 protocol.
1423 Ps = 3 -> never allow shift-key as modifier in mouse
1424 protocol.
1425
1426 If no parameter is given, xterm uses the default, which is 0 .
1427
1428 CSI ? Pm s
1429 Save DEC Private Mode Values (XTSAVE), xterm. Ps values are
1430 the same as for DECSET.
1431
1432 Like Save Cursor (DECSC), this uses a one-level cache. Unlike
1433 Save Cursor, specific settings can be saved and restored
1434 independently. Only those modes listed as parameters are
1435 saved.
1436
1437 CSI Ps ; Ps ; Ps t
1438 Window manipulation (XTWINOPS), dtterm, extended by xterm.
1439 These controls may be disabled using the allowWindowOps
1440 resource.
1441
1442 xterm uses Extended Window Manager Hints (EWMH) to maximize
1443 the window. Some window managers have incomplete support for
1444 EWMH. For instance, fvwm, flwm and quartz-wm advertise
1445 support for maximizing windows horizontally or vertically, but
1446 in fact equate those to the maximize operation.
1447
1448 Valid values for the first (and any additional parameters)
1449 are:
1450 Ps = 1 -> De-iconify window.
1451 Ps = 2 -> Iconify window.
1452 Ps = 3 ; x ; y -> Move window to [x, y].
1453 Ps = 4 ; height ; width -> Resize the xterm window to
1454 given height and width in pixels. Omitted parameters reuse
1455 the current height or width. Zero parameters use the
1456 display's height or width.
1457 Ps = 5 -> Raise the xterm window to the front of the
1458 stacking order.
1459 Ps = 6 -> Lower the xterm window to the bottom of the
1460 stacking order.
1461 Ps = 7 -> Refresh the xterm window.
1462 Ps = 8 ; height ; width -> Resize the text area to given
1463 height and width in characters. Omitted parameters reuse the
1464 current height or width. Zero parameters use the display's
1465 height or width.
1466 Ps = 9 ; 0 -> Restore maximized window.
1467 Ps = 9 ; 1 -> Maximize window (i.e., resize to screen
1468 size).
1469 Ps = 9 ; 2 -> Maximize window vertically.
1470 Ps = 9 ; 3 -> Maximize window horizontally.
1471 Ps = 1 0 ; 0 -> Undo full-screen mode.
1472 Ps = 1 0 ; 1 -> Change to full-screen.
1473 Ps = 1 0 ; 2 -> Toggle full-screen.
1474 Ps = 1 1 -> Report xterm window state.
1475 If the xterm window is non-iconified, it returns CSI 1 t .
1476 If the xterm window is iconified, it returns CSI 2 t .
1477 Ps = 1 3 -> Report xterm window position.
1478 Note: X Toolkit positions can be negative, but the reported
1479 values are unsigned, in the range 0-65535. Negative values
1480 correspond to 32768-65535.
1481 Result is CSI 3 ; x ; y t
1482 Ps = 1 3 ; 2 -> Report xterm text-area position.
1483 Result is CSI 3 ; x ; y t
1484 Ps = 1 4 -> Report xterm text area size in pixels.
1485 Result is CSI 4 ; height ; width t
1486 Ps = 1 4 ; 2 -> Report xterm window size in pixels.
1487 Normally xterm's window is larger than its text area, since it
1488 includes the frame (or decoration) applied by the window
1489 manager, as well as the area used by a scroll-bar.
1490 Result is CSI 4 ; height ; width t
1491 Ps = 1 5 -> Report size of the screen in pixels.
1492 Result is CSI 5 ; height ; width t
1493 Ps = 1 6 -> Report xterm character cell size in pixels.
1494 Result is CSI 6 ; height ; width t
1495 Ps = 1 8 -> Report the size of the text area in characters.
1496 Result is CSI 8 ; height ; width t
1497 Ps = 1 9 -> Report the size of the screen in characters.
1498 Result is CSI 9 ; height ; width t
1499 Ps = 2 0 -> Report xterm window's icon label.
1500 Result is OSC L label ST
1501 Ps = 2 1 -> Report xterm window's title.
1502 Result is OSC l label ST
1503 Ps = 2 2 ; 0 -> Save xterm icon and window title on stack.
1504 Ps = 2 2 ; 1 -> Save xterm icon title on stack.
1505 Ps = 2 2 ; 2 -> Save xterm window title on stack.
1506 Ps = 2 3 ; 0 -> Restore xterm icon and window title from
1507 stack.
1508 Ps = 2 3 ; 1 -> Restore xterm icon title from stack.
1509 Ps = 2 3 ; 2 -> Restore xterm window title from stack.
1510 Ps >= 2 4 -> Resize to Ps lines (DECSLPP), VT340 and VT420.
1511 xterm adapts this by resizing its window.
1512
1513 CSI > Pm t
1514 This xterm control sets one or more features of the title
1515 modes (XTSMTITLE), xterm. Each parameter enables a single
1516 feature.
1517 Ps = 0 -> Set window/icon labels using hexadecimal.
1518 Ps = 1 -> Query window/icon labels using hexadecimal.
1519 Ps = 2 -> Set window/icon labels using UTF-8.
1520 Ps = 3 -> Query window/icon labels using UTF-8. (See
1521 discussion of Title Modes)
1522
1523 CSI Ps SP t
1524 Set warning-bell volume (DECSWBV), VT520.
1525 Ps = 0 or 1 -> off.
1526 Ps = 2 , 3 or 4 -> low.
1527 Ps = 5 , 6 , 7 , or 8 -> high.
1528
1529 CSI Pt ; Pl ; Pb ; Pr ; Pm $ t
1530 Reverse Attributes in Rectangular Area (DECRARA), VT400 and
1531 up.
1532 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1533 Pm denotes the attributes to reverse, i.e., 1, 4, 5, 7.
1534
1535 CSI u Restore cursor (SCORC, also ANSI.SYS).
1536
1537 CSI Ps SP u
1538 Set margin-bell volume (DECSMBV), VT520.
1539 Ps = 0 , 5 , 6 , 7 , or 8 -> high.
1540 Ps = 1 -> off.
1541 Ps = 2 , 3 or 4 -> low.
1542
1543 CSI Pt ; Pl ; Pb ; Pr ; Pp ; Pt ; Pl ; Pp $ v
1544 Copy Rectangular Area (DECCRA), VT400 and up.
1545 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1546 Pp denotes the source page.
1547 Pt ; Pl denotes the target location.
1548 Pp denotes the target page.
1549
1550 CSI Ps $ w
1551 Request presentation state report (DECRQPSR), VT320 and up.
1552 Ps = 0 -> error.
1553 Ps = 1 -> cursor information report (DECCIR).
1554 Response is
1555 DCS 1 $ u Pt ST
1556 Refer to the VT420 programming manual, which requires six
1557 pages to document the data string Pt,
1558 Ps = 2 -> tab stop report (DECTABSR).
1559 Response is
1560 DCS 2 $ u Pt ST
1561 The data string Pt is a list of the tab-stops, separated by
1562 "/" characters.
1563
1564 CSI Pt ; Pl ; Pb ; Pr ' w
1565 Enable Filter Rectangle (DECEFR), VT420 and up.
1566 Parameters are [top;left;bottom;right].
1567 Defines the coordinates of a filter rectangle and activates
1568 it. Anytime the locator is detected outside of the filter
1569 rectangle, an outside rectangle event is generated and the
1570 rectangle is disabled. Filter rectangles are always treated
1571 as "one-shot" events. Any parameters that are omitted default
1572 to the current locator position. If all parameters are
1573 omitted, any locator motion will be reported. DECELR always
1574 cancels any previous rectangle definition.
1575
1576 CSI Ps x Request Terminal Parameters (DECREQTPARM).
1577 if Ps is a "0" (default) or "1", and xterm is emulating VT100,
1578 the control sequence elicits a response of the same form whose
1579 parameters describe the terminal:
1580 Ps -> the given Ps incremented by 2.
1581 Pn = 1 <- no parity.
1582 Pn = 1 <- eight bits.
1583 Pn = 1 <- 2 8 transmit 38.4k baud.
1584 Pn = 1 <- 2 8 receive 38.4k baud.
1585 Pn = 1 <- clock multiplier.
1586 Pn = 0 <- STP flags.
1587
1588 CSI Ps * x
1589 Select Attribute Change Extent (DECSACE), VT420 and up.
1590 Ps = 0 -> from start to end position, wrapped.
1591 Ps = 1 -> from start to end position, wrapped.
1592 Ps = 2 -> rectangle (exact).
1593
1594 CSI Pc ; Pt ; Pl ; Pb ; Pr $ x
1595 Fill Rectangular Area (DECFRA), VT420 and up.
1596 Pc is the character to use.
1597 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1598
1599 CSI Ps # y
1600 Select checksum extension (XTCHECKSUM), xterm. The bits of Ps
1601 modify the calculation of the checksum returned by DECRQCRA:
1602 0 -> do not negate the result.
1603 1 -> do not report the VT100 video attributes.
1604 2 -> do not omit checksum for blanks.
1605 3 -> omit checksum for cells not explicitly initialized.
1606 4 -> do not mask cell value to 8 bits or ignore combining
1607 characters.
1608 5 -> do not mask cell value to 7 bits.
1609
1610 CSI Pi ; Pg ; Pt ; Pl ; Pb ; Pr * y
1611 Request Checksum of Rectangular Area (DECRQCRA), VT420 and up.
1612 Response is
1613 DCS Pi ! ~ x x x x ST
1614 Pi is the request id.
1615 Pg is the page number.
1616 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1617 The x's are hexadecimal digits 0-9 and A-F.
1618
1619 CSI Ps ; Pu ' z
1620 Enable Locator Reporting (DECELR).
1621 Valid values for the first parameter:
1622 Ps = 0 -> Locator disabled (default).
1623 Ps = 1 -> Locator enabled.
1624 Ps = 2 -> Locator enabled for one report, then disabled.
1625 The second parameter specifies the coordinate unit for locator
1626 reports.
1627 Valid values for the second parameter:
1628 Pu = 0 or omitted -> default to character cells.
1629 Pu = 1 <- device physical pixels.
1630 Pu = 2 <- character cells.
1631
1632 CSI Pt ; Pl ; Pb ; Pr $ z
1633 Erase Rectangular Area (DECERA), VT400 and up.
1634 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1635
1636 CSI Pm ' {
1637 Select Locator Events (DECSLE).
1638 Valid values for the first (and any additional parameters)
1639 are:
1640 Ps = 0 -> only respond to explicit host requests (DECRQLP).
1641 This is default. It also cancels any filter rectangle.
1642 Ps = 1 -> report button down transitions.
1643 Ps = 2 -> do not report button down transitions.
1644 Ps = 3 -> report button up transitions.
1645 Ps = 4 -> do not report button up transitions.
1646
1647 CSI # {
1648 CSI Pm # {
1649 Push video attributes onto stack (XTPUSHSGR), xterm. The
1650 optional parameters correspond to the SGR encoding for video
1651 attributes, except for colors (which do not have a unique SGR
1652 code):
1653 Ps = 1 -> Bold.
1654 Ps = 2 -> Faint.
1655 Ps = 3 -> Italicized.
1656 Ps = 4 -> Underlined.
1657 Ps = 5 -> Blink.
1658 Ps = 7 -> Inverse.
1659 Ps = 8 -> Invisible.
1660 Ps = 9 -> Crossed-out characters.
1661 Ps = 2 1 -> Doubly-underlined.
1662 Ps = 3 0 -> Foreground color.
1663 Ps = 3 1 -> Background color.
1664
1665 If no parameters are given, all of the video attributes are
1666 saved. The stack is limited to 10 levels.
1667
1668 CSI Pt ; Pl ; Pb ; Pr $ {
1669 Selective Erase Rectangular Area (DECSERA), VT400 and up.
1670 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1671
1672 CSI Pt ; Pl ; Pb ; Pr # |
1673 Report selected graphic rendition (XTREPORTSGR), xterm. The
1674 response is an SGR sequence which contains the attributes
1675 which are common to all cells in a rectangle.
1676 Pt ; Pl ; Pb ; Pr denotes the rectangle.
1677
1678 CSI Ps $ |
1679 Select columns per page (DECSCPP), VT340.
1680 Ps = 0 -> 80 columns, default if Ps omitted.
1681 Ps = 8 0 -> 80 columns.
1682 Ps = 1 3 2 -> 132 columns.
1683
1684 CSI Ps ' |
1685 Request Locator Position (DECRQLP).
1686 Valid values for the parameter are:
1687 Ps = 0 , 1 or omitted -> transmit a single DECLRP locator
1688 report.
1689
1690 If Locator Reporting has been enabled by a DECELR, xterm will
1691 respond with a DECLRP Locator Report. This report is also
1692 generated on button up and down events if they have been
1693 enabled with a DECSLE, or when the locator is detected outside
1694 of a filter rectangle, if filter rectangles have been enabled
1695 with a DECEFR.
1696
1697 <- CSI Pe ; Pb ; Pr ; Pc ; Pp & w
1698
1699 Parameters are [event;button;row;column;page].
1700 Valid values for the event:
1701 Pe = 0 <- locator unavailable - no other parameters sent.
1702 Pe = 1 <- request - xterm received a DECRQLP.
1703 Pe = 2 <- left button down.
1704 Pe = 3 <- left button up.
1705 Pe = 4 <- middle button down.
1706 Pe = 5 <- middle button up.
1707 Pe = 6 <- right button down.
1708 Pe = 7 <- right button up.
1709 Pe = 8 <- M4 button down.
1710 Pe = 9 <- M4 button up.
1711 Pe = 1 0 <- locator outside filter rectangle.
1712 The "button" parameter is a bitmask indicating which buttons
1713 are pressed:
1714 Pb = 0 <- no buttons down.
1715 Pb & 1 <- right button down.
1716 Pb & 2 <- middle button down.
1717 Pb & 4 <- left button down.
1718 Pb & 8 <- M4 button down.
1719 The "row" and "column" parameters are the coordinates of the
1720 locator position in the xterm window, encoded as ASCII
1721 decimal.
1722 The "page" parameter is not used by xterm.
1723
1724 CSI Ps * |
1725 Select number of lines per screen (DECSNLS), VT420 and up.
1726
1727 CSI # } Pop video attributes from stack (XTPOPSGR), xterm. Popping
1728 restores the video-attributes which were saved using XTPUSHSGR
1729 to their previous state.
1730
1731 CSI Ps ' }
1732 Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.
1733
1734 CSI Ps $ }
1735 Select active status display (DECSASD), VT320 and up.
1736 Ps = 0 -> main (default)
1737 Ps = 1 -> status line
1738
1739 CSI Ps ' ~
1740 Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.
1741
1742 CSI Ps $ ~
1743 Select status line type (DECSSDT), VT320 and up.
1744 Ps = 0 -> none
1745 Ps = 1 -> indicator (default)
1746 Ps = 2 -> host-writable.
1747
1748
1749 Operating System Commands
1750
1751 OSC Ps ; Pt BEL
1752
1753 OSC Ps ; Pt ST
1754 Set Text Parameters. Some control sequences return
1755 information:
1756 o For colors and font, if Pt is a "?", the control sequence
1757 elicits a response which consists of the control sequence
1758 which would set the corresponding value.
1759 o The dtterm control sequences allow you to determine the
1760 icon name and window title.
1761
1762 XTerm accepts either BEL or ST for terminating OSC
1763 sequences, and when returning information, uses the same
1764 terminator used in a query. While the latter is preferred,
1765 the former is supported for legacy applications:
1766 o Although documented in the changes for X.V10R4 (December
1767 1986), BEL as a string terminator dates from X11R4
1768 (December 1989).
1769 o Since XFree86-3.1.2Ee (August 1996), xterm has accepted ST
1770 (the documented string terminator in ECMA-48).
1771
1772 Ps specifies the type of operation to perform:
1773 Ps = 0 -> Change Icon Name and Window Title to Pt.
1774 Ps = 1 -> Change Icon Name to Pt.
1775 Ps = 2 -> Change Window Title to Pt.
1776 Ps = 3 -> Set X property on top-level window. Pt should be
1777 in the form "prop=value", or just "prop" to delete the
1778 property.
1779 Ps = 4 ; c ; spec -> Change Color Number c to the color
1780 specified by spec.
1781
1782 The spec can be a name or RGB specification as per
1783 XParseColor. Any number of c/spec pairs may be given. The
1784 color numbers correspond to the ANSI colors 0-7, their bright
1785 versions 8-15, and if supported, the remainder of the 88-color
1786 or 256-color table.
1787
1788 If a "?" is given rather than a name or RGB specification,
1789 xterm replies with a control sequence of the same form which
1790 can be used to set the corresponding color. Because more than
1791 one pair of color number and specification can be given in one
1792 control sequence, xterm can make more than one reply.
1793
1794 Ps = 5 ; c ; spec -> Change Special Color Number c to the
1795 color specified by spec.
1796
1797 The spec parameter can be a name or RGB specification as per
1798 XParseColor. Any number of c/spec pairs may be given. The
1799 special colors can also be set by adding the maximum number of
1800 colors (e.g., 88 or 256) to these codes in an OSC 4 control:
1801
1802 Pc = 0 <- resource colorBD (BOLD).
1803 Pc = 1 <- resource colorUL (UNDERLINE).
1804 Pc = 2 <- resource colorBL (BLINK).
1805 Pc = 3 <- resource colorRV (REVERSE).
1806 Pc = 4 <- resource colorIT (ITALIC).
1807
1808 Ps = 6 ; c ; f -> Enable/disable Special Color Number c.
1809 The second parameter tells xterm to enable the corresponding
1810 color mode if nonzero, disable it if zero. OSC 6 is the same
1811 as OSC 1 0 6 .
1812
1813 If no parameters are given, this control has no effect.
1814
1815 The 10 colors (below) which may be set or queried using 1 0
1816 through 1 9 are denoted dynamic colors, since the
1817 corresponding control sequences were the first means for
1818 setting xterm's colors dynamically, i.e., after it was
1819 started. They are not the same as the ANSI colors (however,
1820 the dynamic text foreground and background colors are used
1821 when ANSI colors are reset using SGR 3 9 and 4 9 ,
1822 respectively). These controls may be disabled using the
1823 allowColorOps resource. At least one parameter is expected
1824 for Pt. Each successive parameter changes the next color in
1825 the list. The value of Ps tells the starting point in the
1826 list. The colors are specified by name or RGB specification
1827 as per XParseColor.
1828
1829 If a "?" is given rather than a name or RGB specification,
1830 xterm replies with a control sequence of the same form which
1831 can be used to set the corresponding dynamic color. Because
1832 more than one pair of color number and specification can be
1833 given in one control sequence, xterm can make more than one
1834 reply.
1835
1836 Ps = 1 0 -> Change VT100 text foreground color to Pt.
1837 Ps = 1 1 -> Change VT100 text background color to Pt.
1838 Ps = 1 2 -> Change text cursor color to Pt.
1839 Ps = 1 3 -> Change pointer foreground color to Pt.
1840 Ps = 1 4 -> Change pointer background color to Pt.
1841 Ps = 1 5 -> Change Tektronix foreground color to Pt.
1842 Ps = 1 6 -> Change Tektronix background color to Pt.
1843 Ps = 1 7 -> Change highlight background color to Pt.
1844 Ps = 1 8 -> Change Tektronix cursor color to Pt.
1845 Ps = 1 9 -> Change highlight foreground color to Pt.
1846
1847 Ps = 2 2 -> Change pointer cursor to Pt.
1848
1849 Ps = 4 6 -> Change Log File to Pt. This is normally
1850 disabled by a compile-time option.
1851
1852 Ps = 5 0 -> Set Font to Pt. These controls may be disabled
1853 using the allowFontOps resource. If Pt begins with a "#",
1854 index in the font menu, relative (if the next character is a
1855 plus or minus sign) or absolute. A number is expected but not
1856 required after the sign (the default is the current entry for
1857 relative, zero for absolute indexing).
1858
1859 The same rule (plus or minus sign, optional number) is used
1860 when querying the font. The remainder of Pt is ignored.
1861
1862 A font can be specified after a "#" index expression, by
1863 adding a space and then the font specifier.
1864
1865 If the TrueType Fonts menu entry is set (the renderFont
1866 resource), then this control sets/queries the faceName
1867 resource.
1868
1869 Ps = 5 1 -> reserved for Emacs shell.
1870
1871 Ps = 5 2 -> Manipulate Selection Data. These controls may
1872 be disabled using the allowWindowOps resource. The parameter
1873 Pt is parsed as
1874 Pc ; Pd
1875
1876 The first, Pc, may contain zero or more characters from the
1877 set c , p , q , s , 0 , 1 , 2 , 3 , 4 , 5 , 6 , and 7 . It is
1878 used to construct a list of selection parameters for
1879 clipboard, primary, secondary, select, or cut-buffers 0
1880 through 7 respectively, in the order given. If the parameter
1881 is empty, xterm uses s 0 , to specify the configurable
1882 primary/clipboard selection and cut-buffer 0.
1883
1884 The second parameter, Pd, gives the selection data. Normally
1885 this is a string encoded in base64 (RFC-4648). The data
1886 becomes the new selection, which is then available for pasting
1887 by other applications.
1888
1889 If the second parameter is a ? , xterm replies to the host
1890 with the selection data encoded using the same protocol. It
1891 uses the first selection found by asking successively for each
1892 item from the list of selection parameters.
1893
1894 If the second parameter is neither a base64 string nor ? ,
1895 then the selection is cleared.
1896
1897 Ps = 6 0 -> Query allowed features (XTQALLOWED). XTerm
1898 replies with
1899
1900 OSC 6 0 ; Pt ST
1901
1902 where Pt is a comma-separated list of the allowed optional
1903 runtime features, i.e., zero or more of these resource names:
1904
1905 allowColorOps
1906 allowFontOps
1907 allowMouseOps
1908 allowPasteControls
1909 allowTcapOps
1910 allowTitleOps
1911 allowWindowOps
1912
1913 Ps = 6 1 -> Query disallowed features (XTQDISALLOWED). The
1914 second parameter (i.e., the main feature) must be one of the
1915 resource names returned by OSC 6 0 . XTerm replies with
1916
1917 OSC 6 1 ; Pt ST
1918
1919 where Pt is a comma-separated list of the optional runtime
1920 features which would be disallowed if the main feature is
1921 disabled.
1922
1923 Ps = 1 0 4 ; c -> Reset Color Number c. It is reset to the
1924 color specified by the corresponding X resource. Any number
1925 of c parameters may be given. These parameters correspond to
1926 the ANSI colors 0-7, their bright versions 8-15, and if
1927 supported, the remainder of the 88-color or 256-color table.
1928 If no parameters are given, the entire table will be reset.
1929
1930 Ps = 1 0 5 ; c -> Reset Special Color Number c. It is reset
1931 to the color specified by the corresponding X resource. Any
1932 number of c parameters may be given. These parameters
1933 correspond to the special colors which can be set using an OSC
1934 5 control (or by adding the maximum number of colors using an
1935 OSC 4 control).
1936
1937 If no parameters are given, all special colors will be reset.
1938
1939 Ps = 1 0 6 ; c ; f -> Enable/disable Special Color Number c.
1940 The second parameter tells xterm to enable the corresponding
1941 color mode if nonzero, disable it if zero.
1942
1943 Pc = 0 <- resource colorBDMode (BOLD).
1944 Pc = 1 <- resource colorULMode (UNDERLINE).
1945 Pc = 2 <- resource colorBLMode (BLINK).
1946 Pc = 3 <- resource colorRVMode (REVERSE).
1947 Pc = 4 <- resource colorITMode (ITALIC).
1948 Pc = 5 <- resource colorAttrMode (Override ANSI).
1949
1950 If no parameters are given, this control has no effect.
1951
1952 The dynamic colors can also be reset to their default
1953 (resource) values:
1954 Ps = 1 1 0 -> Reset VT100 text foreground color.
1955 Ps = 1 1 1 -> Reset VT100 text background color.
1956 Ps = 1 1 2 -> Reset text cursor color.
1957 Ps = 1 1 3 -> Reset pointer foreground color.
1958 Ps = 1 1 4 -> Reset pointer background color.
1959 Ps = 1 1 5 -> Reset Tektronix foreground color.
1960 Ps = 1 1 6 -> Reset Tektronix background color.
1961 Ps = 1 1 7 -> Reset highlight color.
1962 Ps = 1 1 8 -> Reset Tektronix cursor color.
1963 Ps = 1 1 9 -> Reset highlight foreground color.
1964
1965 Ps = I ; c -> Set icon to file. Sun shelltool, CDE dtterm.
1966 The file is expected to be XPM format, and uses the same
1967 search logic as the iconHint resource.
1968
1969 Ps = l ; c -> Set window title. Sun shelltool, CDE dtterm.
1970
1971 Ps = L ; c -> Set icon label. Sun shelltool, CDE dtterm.
1972
1973
1974 Privacy Message
1975
1976 PM Pt ST xterm implements no PM functions; Pt is ignored. Pt need not
1977 be printable characters.
1978
1979
1980 Special Keyboard Keys
1981
1982 Terminal keyboards have two types of keys:
1983
1984 o ordinary keys, which you would use as data, e.g., in a text file,
1985 and
1986
1987 o special keys, which you would use to tell xterm to perform some
1988 action.
1989
1990 XTerm detects all of these keys via X key-press and key-release events.
1991 It uses the translations resource to decide what to do with these
1992 events.
1993
1994 o Ordinary keys are handled with the insert-seven-bit or insert-eight-
1995 bit action.
1996
1997 o Special keys may be handled with other resources. However, xterm
1998 also has built-in logic to map commonly-used special keys into
1999 characters which your keypress sends to the application running in
2000 xterm.
2001
2002 Special keyboard keys send control characters or escape sequences. This
2003 is a convention, making it convenient for applications to detect these
2004 keys, rather than a standard.
2005
2006
2007 Alt and Meta Keys
2008
2009 Many keyboards have keys labeled "Alt". Few have keys labeled "Meta".
2010 However, xterm's default translations use the Meta modifier. Common
2011 keyboard configurations assign the Meta modifier to an "Alt" key. By
2012 using xmodmap one may have the modifier assigned to a different key, and
2013 have "real" alt and meta keys. Here is an example:
2014
2015 ! put meta on mod3 to distinguish it from alt
2016 keycode 64 = Alt_L
2017 clear mod1
2018 add mod1 = Alt_L
2019 keycode 115 = Meta_L
2020 clear mod3
2021 add mod3 = Meta_L
2022
2023
2024 The metaSendsEscape resource (and altSendsEscape if altIsNotMeta is set)
2025 can be used to control the way the Meta modifier applies to ordinary
2026 keys unless the modifyOtherKeys resource is set:
2027
2028 o prefix a key with the ESC character.
2029
2030 o shift the key from codes 0-127 to 128-255 by adding 128.
2031
2032 When modifyOtherKeys is set, ordinary keys may be sent as escape
2033 sequences:
2034
2035 o When modifyOtherKeys is set to 1, only the alt- and meta-modifiers
2036 apply. For example, alt-Tab sends CSI 2 7 ; 3 ; 9 ~ (the second
2037 parameter is "3" for alt, and the third parameter is the ASCII value
2038 of tab, "9").
2039
2040 o When modifyOtherKeys is set to 2, all of the modifiers apply. For
2041 example, shift-Tab sends CSI 2 7 ; 2 ; 9 ~ rather than CSI Z (the
2042 second parameter is "2" for shift).
2043
2044 The formatOtherKeys resource tells n to change the format of the escape
2045 sequences sent when modifyOtherKeys applies. When modifyOtherKeys is
2046 set to 1, for example alt-Tab sends CSI 9 ; 3 u (changing the order of
2047 parameters). One drawback to this format is that applications may
2048 confuse it with CSI u (restore-cursor).
2049
2050 The xterm FAQ sections
2051
2052 How can my program distinguish control-I from tab?
2053
2054 XTerm - "Other" Modified Keys
2055
2056 go into greater detail on this topic.
2057
2058 The table shows the result for a given character "x" with modifiers
2059 according to the default translations with the resources set on or off.
2060 This assumes altIsNotMeta is set:
2061
2062 key altSendsEscape metaSendsEscape result
2063 -----------+----------------+-----------------+------------
2064 x | off | off | x
2065 Meta-x | off | off | shift
2066 Alt-x | off | off | shift
2067 Alt+Meta-x | off | off | shift
2068 x | ON | off | x
2069 Meta-x | ON | off | shift
2070 Alt-x | ON | off | ESC x
2071 Alt+Meta-x | ON | off | ESC shift
2072 x | off | ON | x
2073 Meta-x | off | ON | ESC x
2074 Alt-x | off | ON | shift
2075 Alt+Meta-x | off | ON | ESC shift
2076 x | ON | ON | x
2077 Meta-x | ON | ON | ESC x
2078 Alt-x | ON | ON | ESC x
2079 Alt+Meta-x | ON | ON | ESC x
2080 -----------+----------------+-----------------+------------
2081
2082
2083
2084 PC-Style Function Keys
2085
2086 If xterm does minimal translation of the function keys, it usually does
2087 this with a PC-style keyboard, so PC-style function keys result. Sun
2088 keyboards are similar to PC keyboards. Both have cursor and scrolling
2089 operations printed on the keypad, which duplicate the smaller cursor and
2090 scrolling keypads.
2091
2092 X does not predefine NumLock (used for VT220 keyboards) or Alt (used as
2093 an extension for the Sun/PC keyboards) as modifiers. These keys are
2094 recognized as modifiers when enabled by the numLock resource, or by the
2095 "DECSET 1 0 3 5 " control sequence.
2096
2097 The cursor keys transmit the following escape sequences depending on the
2098 mode specified via the DECCKM escape sequence.
2099
2100 Key Normal Application
2101 -------------+----------+-------------
2102 Cursor Up | CSI A | SS3 A
2103 Cursor Down | CSI B | SS3 B
2104 Cursor Right | CSI C | SS3 C
2105 Cursor Left | CSI D | SS3 D
2106 -------------+----------+-------------
2107
2108 The home- and end-keys (unlike PageUp and other keys also on the 6-key
2109 editing keypad) are considered "cursor keys" by xterm. Their mode is
2110 also controlled by the DECCKM escape sequence:
2111
2112 Key Normal Application
2113 ---------+----------+-------------
2114 Home | CSI H | SS3 H
2115 End | CSI F | SS3 F
2116 ---------+----------+-------------
2117
2118
2119 The application keypad transmits the following escape sequences
2120 depending on the mode specified via the DECKPNM and DECKPAM escape
2121 sequences. Use the NumLock key to override the application mode.
2122
2123 Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are
2124 supported by the program.
2125
2126 Key Numeric Application Terminfo Termcap
2127 ---------------+----------+-------------+----------+----------
2128 Space | SP | SS3 SP | - | -
2129 Tab | TAB | SS3 I | - | -
2130 Enter | CR | SS3 M | kent | @8
2131 PF1 | SS3 P | SS3 P | kf1 | k1
2132 PF2 | SS3 Q | SS3 Q | kf2 | k2
2133 PF3 | SS3 R | SS3 R | kf3 | k3
2134 PF4 | SS3 S | SS3 S | kf4 | k4
2135 * (multiply) | * | SS3 j | - | -
2136 + (add) | + | SS3 k | - | -
2137 , (comma) | , | SS3 l | - | -
2138 - (minus) | - | SS3 m | - | -
2139 . (Delete) | . | CSI 3 ~ | - | -
2140 / (divide) | / | SS3 o | - | -
2141 0 (Insert) | 0 | CSI 2 ~ | - | -
2142 1 (End) | 1 | SS3 F | kc1 | K4
2143 2 (DownArrow) | 2 | CSI B | - | -
2144 3 (PageDown) | 3 | CSI 6 ~ | kc3 | K5
2145 4 (LeftArrow) | 4 | CSI D | - | -
2146 5 (Begin) | 5 | CSI E | kb2 | K2
2147 6 (RightArrow) | 6 | CSI C | - | -
2148 7 (Home) | 7 | SS3 H | ka1 | K1
2149 8 (UpArrow) | 8 | CSI A | - | -
2150 9 (PageUp) | 9 | CSI 5 ~ | ka3 | K3
2151 = (equal) | = | SS3 X | - | -
2152 ---------------+----------+-------------+----------+----------
2153
2154 They also provide 12 function keys, as well as a few other special-
2155 purpose keys:
2156
2157 Key Escape Sequence
2158 ---------+-----------------
2159 F1 | SS3 P
2160 F2 | SS3 Q
2161 F3 | SS3 R
2162 F4 | SS3 S
2163 F5 | CSI 1 5 ~
2164 F6 | CSI 1 7 ~
2165 F7 | CSI 1 8 ~
2166 F8 | CSI 1 9 ~
2167 F9 | CSI 2 0 ~
2168 F10 | CSI 2 1 ~
2169 F11 | CSI 2 3 ~
2170 F12 | CSI 2 4 ~
2171 ---------+-----------------
2172
2173
2174 Note that F1 through F4 are prefixed with SS3 , while the other keys are
2175 prefixed with CSI . Older versions of xterm implement different escape
2176 sequences for F1 through F4, with a CSI prefix. These can be activated
2177 by setting the oldXtermFKeys resource. However, since they do not
2178 correspond to any hardware terminal, they have been deprecated. (The
2179 DEC VT220 reserves F1 through F5 for local functions such as Setup).
2180
2181 Key Escape Sequence
2182 ---------+-----------------
2183 F1 | CSI 1 1 ~
2184 F2 | CSI 1 2 ~
2185 F3 | CSI 1 3 ~
2186 F4 | CSI 1 4 ~
2187 ---------+-----------------
2188
2189 In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is
2190 false (and none of the other keyboard resources such as oldXtermFKeys
2191 resource is set), xterm encodes function key modifiers as parameters
2192 appended before the final character of the control sequence. As a
2193 special case, the SS3 sent before F1 through F4 is altered to CSI when
2194 sending a function key modifier as a parameter.
2195
2196 Code Modifiers
2197 ---------+---------------------------
2198 2 | Shift
2199 3 | Alt
2200 4 | Shift + Alt
2201 5 | Control
2202 6 | Shift + Control
2203 7 | Alt + Control
2204 8 | Shift + Alt + Control
2205 9 | Meta
2206 10 | Meta + Shift
2207 11 | Meta + Alt
2208 12 | Meta + Alt + Shift
2209 13 | Meta + Ctrl
2210 14 | Meta + Ctrl + Shift
2211 15 | Meta + Ctrl + Alt
2212 16 | Meta + Ctrl + Alt + Shift
2213 ---------+---------------------------
2214
2215 For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
2216
2217 If the alwaysUseMods resource is set, the Meta modifier also is
2218 recognized, making parameters 9 through 16.
2219
2220 The codes used for the PC-style function keys were inspired by a feature
2221 of the VT510, referred to in its reference manual as DECFNK. In the
2222 DECFNK scheme, codes 2-8 identify modifiers for function-keys and
2223 cursor-, editing-keypad keys. Unlike xterm, the VT510 limits the
2224 modifiers which can be used with cursor- and editing-keypad keys.
2225 Although the name "DECFNK" implies that it is a mode, the VT510 manual
2226 mentions it only as a feature, which (like xterm) interacts with the
2227 DECUDK feature. Unlike xterm, VT510/VT520 provide an extension to
2228 DECUDK (DECPFK and DECPAK) which apparently was the reason for the
2229 feature in those terminals, i.e., for identifying a programmable key
2230 rather than making it simple for applications to obtain modifier
2231 information. It is not described in the related VT520 manual. Neither
2232 manual was readily available at the time the feature was added to xterm.
2233
2234 On the other hand, the VT510 and VT520 reference manuals do document a
2235 related feature. That is its emulation of the SCO console, which is
2236 similar to the "xterm-sco" terminal description. The SCO console
2237 function-keys are less useful to applications developers than the
2238 approach used by xterm because
2239
2240 o the relationship between modifiers and the characters sent by
2241 function-keys is not readily apparent, and
2242
2243 o the scheme is not extensible, i.e., it is an ad hoc assignment
2244 limited to two modifiers (shift and control).
2245
2246
2247 VT220-Style Function Keys
2248
2249 However, xterm is most useful as a DEC VT102 or VT220 emulator. Set the
2250 sunKeyboard resource to true to force a Sun/PC keyboard to act like a
2251 VT220 keyboard.
2252
2253 The VT102/VT220 application keypad transmits unique escape sequences in
2254 application mode, which are distinct from the cursor and scrolling
2255 keypad:
2256
2257 Key Numeric Application VT100?
2258 -------------+----------+-------------+----------
2259 Space | SP | SS3 SP | no
2260 Tab | TAB | SS3 I | no
2261 Enter | CR | SS3 M | yes
2262 PF1 | SS3 P | SS3 P | yes
2263 PF2 | SS3 Q | SS3 Q | yes
2264 PF3 | SS3 R | SS3 R | yes
2265 PF4 | SS3 S | SS3 S | yes
2266 * (multiply) | * | SS3 j | no
2267 + (add) | + | SS3 k | no
2268 , (comma) | , | SS3 l | yes
2269 - (minus) | - | SS3 m | yes
2270 . (period) | . | SS3 n | yes
2271 / (divide) | / | SS3 o | no
2272 0 | 0 | SS3 p | yes
2273 1 | 1 | SS3 q | yes
2274 2 | 2 | SS3 r | yes
2275 3 | 3 | SS3 s | yes
2276 4 | 4 | SS3 t | yes
2277 5 | 5 | SS3 u | yes
2278 6 | 6 | SS3 v | yes
2279 7 | 7 | SS3 w | yes
2280 8 | 8 | SS3 x | yes
2281 9 | 9 | SS3 y | yes
2282 = (equal) | = | SS3 X | no
2283 -------------+----------+-------------+----------
2284
2285
2286 The VT100/VT220 keypad did not have all of those keys. They were
2287 implemented in xterm in X11R1 (1987), defining a mapping of all X11 keys
2288 which might be provided on a keypad. For instance, a Sun4/II type-4
2289 keyboard provided "=" (equal), "/" (divide), and "*" (multiply).
2290
2291 While the VT420 provided the same keypad, the VT520 used a PC-keyboard.
2292 Because that keyboard's keypad lacks the "," (comma), it was not
2293 possible to use EDT's delete-character function with the keypad. XTerm
2294 solves that problem for the VT220-keyboard configuration by mapping
2295
2296 Ctrl + to , and
2297 Ctrl - to -
2298
2299 The VT220 provides a 6-key editing keypad, which is analogous to that on
2300 the PC keyboard. It is not affected by DECCKM or DECKPNM/DECKPAM:
2301
2302 Key Normal Application
2303 ---------+----------+-------------
2304 Insert | CSI 2 ~ | CSI 2 ~
2305 Delete | CSI 3 ~ | CSI 3 ~
2306 Home | CSI 1 ~ | CSI 1 ~
2307 End | CSI 4 ~ | CSI 4 ~
2308 PageUp | CSI 5 ~ | CSI 5 ~
2309 PageDown | CSI 6 ~ | CSI 6 ~
2310 ---------+----------+-------------
2311
2312
2313 The VT220 provides 8 additional function keys. With a Sun/PC keyboard,
2314 access these keys by Control/F1 for F13, etc.
2315
2316 Key Escape Sequence
2317 ---------+-----------------
2318 F13 | CSI 2 5 ~
2319 F14 | CSI 2 6 ~
2320 F15 | CSI 2 8 ~
2321 F16 | CSI 2 9 ~
2322 F17 | CSI 3 1 ~
2323 F18 | CSI 3 2 ~
2324 F19 | CSI 3 3 ~
2325 F20 | CSI 3 4 ~
2326 ---------+-----------------
2327
2328
2329
2330 VT52-Style Function Keys
2331
2332 A VT52 does not have function keys, but it does have a numeric keypad
2333 and cursor keys. They differ from the other emulations by the prefix.
2334 Also, the cursor keys do not change:
2335
2336 Key Normal/Application
2337 -------------+--------------------
2338 Cursor Up | ESC A
2339 Cursor Down | ESC B
2340 Cursor Right | ESC C
2341 Cursor Left | ESC D
2342 -------------+--------------------
2343
2344 The keypad is similar:
2345
2346 Key Numeric Application VT52?
2347 -------------+----------+-------------+----------
2348 Space | SP | ESC ? SP | no
2349 Tab | TAB | ESC ? I | no
2350 Enter | CR | ESC ? M | no
2351 PF1 | ESC P | ESC P | yes
2352 PF2 | ESC Q | ESC Q | yes
2353 PF3 | ESC R | ESC R | yes
2354 PF4 | ESC S | ESC S | no
2355 * (multiply) | * | ESC ? j | no
2356 + (add) | + | ESC ? k | no
2357 , (comma) | , | ESC ? l | no
2358 - (minus) | - | ESC ? m | no
2359 . (period) | . | ESC ? n | yes
2360 / (divide) | / | ESC ? o | no
2361 0 | 0 | ESC ? p | yes
2362 1 | 1 | ESC ? q | yes
2363 2 | 2 | ESC ? r | yes
2364 3 | 3 | ESC ? s | yes
2365 4 | 4 | ESC ? t | yes
2366 5 | 5 | ESC ? u | yes
2367 6 | 6 | ESC ? v | yes
2368 7 | 7 | ESC ? w | yes
2369 8 | 8 | ESC ? x | yes
2370 9 | 9 | ESC ? y | yes
2371 = (equal) | = | ESC ? X | no
2372 -------------+----------+-------------+----------
2373
2374
2375
2376 Sun-Style Function Keys
2377
2378 The xterm program provides support for Sun keyboards more directly, by a
2379 menu toggle that causes it to send Sun-style function key codes rather
2380 than VT220. Note, however, that the sun and VT100 emulations are not
2381 really compatible. For example, their wrap-margin behavior differs.
2382
2383 Only function keys are altered; keypad and cursor keys are the same.
2384 The emulation responds identically. See the xterm-sun terminfo entry
2385 for details.
2386
2387
2388 HP-Style Function Keys
2389
2390 Similarly, xterm can be compiled to support HP keyboards. See the
2391 xterm-hp terminfo entry for details.
2392
2393
2394 Non-Function Keys
2395
2396 On a DEC terminal keyboard, some of the keys which one would expect to
2397 see labeled as function keys had special names. The keys actually send
2398 character sequences as if they were the expected function keys, but the
2399 special names are used in documentation. Because other keyboards may
2400 use those names, xterm maps the X key symbols which have the
2401 corresponding names into the character sequences which the original DEC
2402 keyboard would send.
2403
2404 These mappings are used for the DEC (VT220) and other keyboards:
2405
2406 Label DEC SUN HP SCO
2407 --------------+------------+--------------+----------+----------
2408 Up | SS3 A | SS3 A | ESC A | CSI A
2409 Down | SS3 B | SS3 B | ESC B | CSI B
2410 Right | SS3 C | SS3 C | ESC C | CSI C
2411 Left | SS3 D | SS3 D | ESC D | CSI D
2412 Clear | - | - | ESC J | -
2413 Find | CSI 1 ~ | CSI 1 z | ESC h | -
2414 Insert | CSI 2 ~ | CSI 2 z | ESC Q | CSI L
2415 Delete | CSI 3 ~ | CSI 3 z | ESC P | -
2416 Keypad Insert | CSI 2 ~ | CSI 2 z | ESC Q | CSI L
2417 Keypad Delete | CSI 3 ~ | CSI 3 z | ESC P | -
2418 Remove | CSI 3 ~ | CSI 3 z | ESC P | -
2419 Select | CSI 4 ~ | CSI 4 z | ESC F | -
2420 Prior | CSI 5 ~ | CSI 2 1 6 z | ESC T | CSI I
2421 Next | CSI 6 ~ | CSI 2 2 2 z | ESC S | CSI G
2422 Help | CSI 2 8 ~ | CSI 1 9 6 z | - | -
2423 Menu | CSI 2 9 ~ | CSI 1 9 7 z | - | -
2424 Home | - | CSI 2 1 4 z | ESC h | CSI H
2425 End | - | CSI 2 2 0 z | ESC F | CSI F
2426 Begin | - | CSI 2 1 8 z | - | CSI E
2427 --------------+------------+--------------+----------+----------
2428
2429
2430
2431 The Alternate Screen Buffer
2432
2433 XTerm maintains two screen buffers. The Normal Screen Buffer allows you
2434 to scroll back to view saved lines of output up to the maximum set by
2435 the saveLines resource. The Alternate Screen Buffer is exactly as large
2436 as the display, contains no additional saved lines. When the Alternate
2437 Screen Buffer is active, you cannot scroll back to view saved lines.
2438 XTerm provides control sequences and menu entries for switching between
2439 the two.
2440
2441 Most full-screen applications use terminfo or termcap to obtain strings
2442 used to start/stop full-screen mode, i.e., smcup and rmcup for terminfo,
2443 or the corresponding ti and te for termcap. The titeInhibit resource
2444 removes the ti and te strings from the TERMCAP string which is set in
2445 the environment for some platforms. That is not done when xterm is
2446 built with terminfo libraries because terminfo does not provide the
2447 whole text of the termcap data in one piece. It would not work for
2448 terminfo anyway, since terminfo data is not passed in environment
2449 variables; setting an environment variable in this manner would have no
2450 effect on the application's ability to switch between Normal and
2451 Alternate Screen buffers. Instead, the newer private mode controls
2452 (such as 1 0 4 9 ) for switching between Normal and Alternate Screen
2453 buffers simply disable the switching. They add other features such as
2454 clearing the display for the same reason: to make the details of
2455 switching independent of the application that requests the switch.
2456
2457
2458 Bracketed Paste Mode
2459
2460 When bracketed paste mode is set, pasted text is bracketed with control
2461 sequences so that the program can differentiate pasted text from typed-
2462 in text. When bracketed paste mode is set, the program will receive:
2463 ESC [ 2 0 0 ~ ,
2464 followed by the pasted text, followed by
2465 ESC [ 2 0 1 ~ .
2466 For background and discussion, see the FAQ:
2467
2468 XTerm - bracketed-paste
2469
2470
2471
2472 Readline Modes
2473
2474 Several modes provide support for mouse button events in readline.
2475 Bracketed paste is one of these readline modes, but is used more widely.
2476
2477 Some assumptions (particular mouse buttons) and limitations (the mouse
2478 is clicked on the current row on the screen) apply:
2479
2480 2 0 0 1 If mouse button 1 is used to end or extend a selection (the
2481 select-end action), and if the cursor position is on the same
2482 row as the mouse-click, send left/right cursor control
2483 sequences to the host to adjust the cursor position to match
2484 the mouse click.
2485
2486 2 0 0 2 When pasting text (the insert-selection action which is
2487 normally bound to mouse button 2), if mouse protocol is not
2488 enabled, and if the cursor position is on the same row as the
2489 mouse-click, send left/right cursor control sequences to the
2490 host to adjust the cursor position to match the mouse click.
2491
2492 2 0 0 3 If mouse button 3 is double-clicked when ending or extending a
2493 selection, (the select-end action), and if the cursor position
2494 is on the same row as the mouse-click, send left/right cursor
2495 control sequences to the host to adjust the cursor position to
2496 match the mouse click. After adjusting the cursor position,
2497 xterm sends erase-characters (one for each character in the
2498 selection) to tell the host to delete the selected text.
2499
2500 2 0 0 5 When writing a selection to the host (i.e., pasting text),
2501 escape each character with the literal-next (Ctrl-V)
2502 character.
2503
2504 2 0 0 6 Normally when xterm writes selections to the host, it
2505 translates newlines to carriage returns. This mode disables
2506 the translation, passing newlines literally.
2507
2508
2509 Title Modes
2510
2511 The window- and icon-labels can be set or queried using control
2512 sequences. As a VT220-emulator, xterm "should" limit the character
2513 encoding for the corresponding strings to ISO-8859-1. Indeed, it used
2514 to be the case (and was documented) that window titles had to be
2515 ISO-8859-1. This is no longer the case. However, there are many
2516 applications which still assume that titles are set using ISO-8859-1.
2517 So that is the default behavior.
2518
2519 If xterm is running with UTF-8 encoding, it is possible to use window-
2520 and icon-labels encoded using UTF-8. That is because the underlying X
2521 libraries (and many, but not all) window managers support this feature.
2522
2523 The utf8Title X resource setting tells xterm to disable a reconversion
2524 of the title string back to ISO-8859-1, allowing the title strings to be
2525 interpreted as UTF-8. The same feature can be enabled using the title
2526 mode control sequence described in this summary.
2527
2528 Separate from the ability to set the titles, xterm provides the ability
2529 to query the titles, returning them either in ISO-8859-1 or UTF-8. This
2530 choice is available only while xterm is using UTF-8 encoding.
2531
2532 Finally, the characters sent to, or returned by a title control are less
2533 constrained than the rest of the control sequences. To make them more
2534 manageable (and constrained), for use in shell scripts, xterm has an
2535 optional feature which decodes the string from hexadecimal (for setting
2536 titles) or for encoding the title into hexadecimal when querying the
2537 value.
2538
2539
2540 Mouse Tracking
2541
2542 The VT widget can be set to send the mouse position and other
2543 information on button presses. These modes are typically used by
2544 editors and other full-screen applications that want to make use of the
2545 mouse.
2546
2547 There are two sets of mutually exclusive modes:
2548
2549 o mouse protocol
2550
2551 o protocol encoding
2552
2553 The mouse protocols include DEC Locator mode, enabled by the DECELR CSI
2554 Ps ; Ps ' z control sequence, and is not described here (control
2555 sequences are summarized above). The remaining five modes of the mouse
2556 protocols are each enabled (or disabled) by a different parameter in the
2557 "DECSET CSI ? Pm h " or "DECRST CSI ? Pm l " control sequence.
2558
2559 Manifest constants for the parameter values are defined in xcharmouse.h
2560 as follows:
2561
2562 #define SET_X10_MOUSE 9
2563 #define SET_VT200_MOUSE 1000
2564 #define SET_VT200_HIGHLIGHT_MOUSE 1001
2565 #define SET_BTN_EVENT_MOUSE 1002
2566 #define SET_ANY_EVENT_MOUSE 1003
2567
2568 #define SET_FOCUS_EVENT_MOUSE 1004
2569
2570 #define SET_ALTERNATE_SCROLL 1007
2571
2572 #define SET_EXT_MODE_MOUSE 1005
2573 #define SET_SGR_EXT_MODE_MOUSE 1006
2574 #define SET_URXVT_EXT_MODE_MOUSE 1015
2575 #define SET_PIXEL_POSITION_MOUSE 1016
2576
2577 The motion reporting modes are strictly xterm extensions, and are not
2578 part of any standard, though they are analogous to the DEC VT200 DECELR
2579 locator reports.
2580
2581 Normally, parameters (such as pointer position and button number) for
2582 all mouse tracking escape sequences generated by xterm encode numeric
2583 parameters in a single character as value+32. For example, ! specifies
2584 the value 1. The upper left character position on the terminal is
2585 denoted as 1,1. This scheme dates back to X10, though the normal mouse-
2586 tracking (from X11) is more elaborate.
2587
2588
2589 X10 compatibility mode
2590
2591 X10 compatibility mode sends an escape sequence only on button press,
2592 encoding the location and the mouse button pressed. It is enabled by
2593 specifying parameter 9 to DECSET. On button press, xterm sends CSI M
2594 CbCxCy (6 characters).
2595
2596 o Cb is button-1, where button is 1, 2 or 3.
2597
2598 o Cx and Cy are the x and y coordinates of the mouse when the button
2599 was pressed.
2600
2601
2602 Normal tracking mode
2603
2604 Normal tracking mode sends an escape sequence on both button press and
2605 release. Modifier key (shift, ctrl, meta) information is also sent. It
2606 is enabled by specifying parameter 1000 to DECSET. On button press or
2607 release, xterm sends CSI M CbCxCy.
2608
2609 o The low two bits of Cb encode button information:
2610
2611 0=MB1 pressed,
2612 1=MB2 pressed,
2613 2=MB3 pressed, and
2614 3=release.
2615
2616 o The next three bits encode the modifiers which were down when the
2617 button was pressed and are added together:
2618
2619 4=Shift,
2620 8=Meta, and
2621 16=Control.
2622
2623 The shift and control modifiers are normally irrelevant because
2624 xterm uses the control modifier with mouse for popup menus, and the
2625 shift modifier is used in the default translations for button
2626 events.
2627
2628 There is no predefined meta modifier. XTerm checks first if the
2629 keysyms listed in the predefined modifiers include Meta_L or Meta_R.
2630 If found, xterm uses that modifier for meta. Next, it tries Alt_L
2631 or Alt_R. If none of those are found, xterm uses the mod1 modifier,
2632 This is not necessarily the "Meta" key according to xmodmap(1).
2633
2634 o Cx and Cy are the x and y coordinates of the mouse event, encoded as
2635 in X10 mode.
2636
2637
2638 Wheel mice
2639
2640 Wheel mice may return buttons 4 and 5. Those buttons are represented by
2641 the same event codes as buttons 1 and 2 respectively, except that 64 is
2642 added to the event code. Release events for the wheel buttons are not
2643 reported.
2644
2645 By default, the wheel mouse events (buttons 4 and 5) are translated to
2646 scroll-back and scroll-forw actions, respectively. Those actions
2647 normally scroll the whole window, as if the scrollbar was used.
2648
2649 However if Alternate Scroll mode is set, then cursor up/down controls
2650 are sent when the terminal is displaying the Alternate Screen Buffer.
2651 The initial state of Alternate Scroll mode is set using the
2652 alternateScroll resource.
2653
2654
2655 Other buttons
2656
2657 Some wheel mice can send additional button events, e.g., by tilting the
2658 scroll wheel left and right.
2659
2660 Additional buttons are encoded like the wheel mice,
2661
2662 o by adding 64 (for buttons 6 and 7), or
2663
2664 o by adding 128 (for buttons 8 through 11).
2665
2666 Past button 11, the encoding is ambiguous because the same code may
2667 correspond to different button/modifier combinations.
2668
2669 It is not possible to use these buttons (6-11) in xterm's translations
2670 resource because their names are not in the X Toolkit's symbol table.
2671 However, applications can check for the reports, e.g., button 7 (left)
2672 and button 6 (right) with a Logitech mouse.
2673
2674
2675 Highlight tracking
2676
2677 Mouse highlight tracking notifies a program of a button press, receives
2678 a range of lines from the program, highlights the region covered by the
2679 mouse within that range until button release, and then sends the program
2680 the release coordinates. It is enabled by specifying parameter 1001 to
2681 DECSET. Highlighting is performed only for button 1, though other
2682 button events can be received.
2683
2684 Warning: this mode requires a cooperating program, else xterm will hang.
2685
2686 On button press, the same information as for normal tracking is
2687 generated; xterm then waits for the program to send mouse tracking
2688 information. All X events are ignored until the proper escape sequence
2689 is received from the pty:
2690 CSI Ps ; Ps ; Ps ; Ps ; Ps T
2691
2692 The parameters are func, startx, starty, firstrow, and lastrow:
2693
2694 o func is non-zero to initiate highlight tracking and zero to abort.
2695
2696 o startx and starty give the starting x and y location for the
2697 highlighted region.
2698
2699 o The ending location tracks the mouse, but will never be above row
2700 firstrow and will always be above row lastrow. (The top of the
2701 screen is row 1.)
2702
2703 When the button is released, xterm reports the ending position one of
2704 two ways:
2705
2706 o if the start and end coordinates are the same locations:
2707
2708 CSI t CxCy
2709
2710 o otherwise:
2711
2712 CSI T CxCyCxCyCxCy
2713
2714 The parameters are startx, starty, endx, endy, mousex, and mousey:
2715
2716 o startx, starty, endx, and endy give the starting and ending
2717 character positions of the region.
2718
2719 o mousex and mousey give the location of the mouse at button up, which
2720 may not be over a character.
2721
2722
2723 Button-event tracking
2724
2725 Button-event tracking is essentially the same as normal tracking, but
2726 xterm also reports button-motion events. Motion events are reported
2727 only if the mouse pointer has moved to a different character cell. It
2728 is enabled by specifying parameter 1002 to DECSET. On button press or
2729 release, xterm sends the same codes used by normal tracking mode.
2730
2731 o On button-motion events, xterm adds 32 to the event code (the third
2732 character, Cb).
2733
2734 o The other bits of the event code specify button and modifier keys as
2735 in normal mode. For example, motion into cell x,y with button 1
2736 down is reported as
2737
2738 CSI M @ CxCy
2739
2740 ( @ = 32 + 0 (button 1) + 32 (motion indicator) ). Similarly,
2741 motion with button 3 down is reported as
2742
2743 CSI M B CxCy
2744
2745 ( B = 32 + 2 (button 3) + 32 (motion indicator) ).
2746
2747
2748 Any-event tracking
2749
2750 Any-event mode is the same as button-event mode, except that all motion
2751 events are reported, even if no mouse button is down. It is enabled by
2752 specifying 1003 to DECSET.
2753
2754
2755 FocusIn/FocusOut
2756
2757 FocusIn/FocusOut can be combined with any of the mouse events since it
2758 uses a different protocol. When set, it causes xterm to send CSI I
2759 when the terminal gains focus, and CSI O when it loses focus.
2760
2761
2762 Extended coordinates
2763
2764 The original X10 mouse protocol limits the Cx and Cy ordinates to 223
2765 (=255 - 32). XTerm supports more than one scheme for extending this
2766 range, by changing the protocol encoding:
2767
2768 UTF-8 (1005)
2769 This enables UTF-8 encoding for Cx and Cy under all tracking
2770 modes, expanding the maximum encodable position from 223 to
2771 2015. For positions less than 95, the resulting output is
2772 identical under both modes. Under extended mouse mode,
2773 positions greater than 95 generate "extra" bytes which will
2774 confuse applications which do not treat their input as a UTF-8
2775 stream. Likewise, Cb will be UTF-8 encoded, to reduce
2776 confusion with wheel mouse events.
2777
2778 Under normal mouse mode, positions outside (160,94) result in
2779 byte pairs which can be interpreted as a single UTF-8
2780 character; applications which do treat their input as UTF-8
2781 will almost certainly be confused unless extended mouse mode
2782 is active.
2783
2784 This scheme has the drawback that the encoded coordinates will
2785 not pass through luit(1) unchanged, e.g., for locales using
2786 non-UTF-8 encoding.
2787
2788 SGR (1006)
2789 The normal mouse response is altered to use
2790
2791 o CSI < followed by semicolon-separated
2792
2793 o encoded button value,
2794
2795 o Px and Py ordinates and
2796
2797 o a final character which is M for button press and m for
2798 button release.
2799
2800 The encoded button value in this case does not add 32 since
2801 that was useful only in the X10 scheme for ensuring that the
2802 byte containing the button value is a printable code.
2803
2804 o The modifiers are encoded in the same way.
2805
2806 o A different final character is used for button release to
2807 resolve the X10 ambiguity regarding which button was
2808 released.
2809
2810 The highlight tracking responses are also modified to an SGR-
2811 like format, using the same SGR-style scheme and button-
2812 encodings.
2813
2814 URXVT (1015)
2815 The normal mouse response is altered to use
2816
2817 o CSI followed by semicolon-separated
2818
2819 o encoded button value,
2820
2821 o the Px and Py ordinates and final character M .
2822
2823 This uses the same button encoding as X10, but printing it as
2824 a decimal integer rather than as a single byte.
2825
2826 However, CSI M can be mistaken for DL (delete lines), while
2827 the highlight tracking CSI T can be mistaken for SD (scroll
2828 down), and the Window manipulation controls. For these
2829 reasons, the 1015 control is not recommended; it is not an
2830 improvement over 1006.
2831
2832 SGR-Pixels (1016)
2833 Use the same mouse response format as the 1006 control, but
2834 report position in pixels rather than character cells.
2835
2836
2837 Graphics
2838
2839
2840 Sixel Graphics
2841
2842 If xterm is configured as VT240, VT241, VT330, VT340 or VT382 using the
2843 decTerminalID or decGraphicsID resource, it supports Sixel Graphics
2844 controls, a paletted bitmap graphics system using sets of six vertical
2845 pixels as the basic element.
2846
2847 CSI Ps c Send Device Attributes (Primary DA), DEC graphics terminals,
2848 xterm. xterm responds to Send Device Attributes (Primary DA)
2849 with these additional codes:
2850 Ps = 4 -> Sixel graphics.
2851
2852 CSI ? Pm h
2853 Set Mode (with corresponding Reset Mode CSI ? Pm l ):
2854 Ps = 8 0 -> Sixel Display Mode (DECSDM), VT330, VT340,
2855 VT382.
2856 Ps = 1 0 7 0 -> use private color registers for each
2857 graphic, xterm.
2858 Ps = 8 4 5 2 -> Sixel scrolling leaves cursor to right of
2859 graphic, RLogin, xterm.
2860
2861 DCS Pa ; Pb ; Ph q Ps..Ps ST
2862 Send SIXEL image, DEC graphics terminals, VT330, VT340, VT382.
2863 See:
2864
2865 VT330/VT340 Programmer Reference Manual Volume 2:
2866 Graphics Programming
2867 Chapter 14 Graphics Programming
2868
2869 The sixel data device control string has three positional
2870 parameters, following the q with sixel data.
2871 Pa -> pixel aspect ratio
2872 Pb -> background color option
2873 Ph -> horizontal grid size (ignored).
2874 Ps -> sixel data
2875
2876
2877 ReGIS Graphics
2878
2879 If xterm is configured as VT125, VT240, VT241, VT330 or VT340 using the
2880 decTerminalID or decGraphicsID resource, it supports Remote Graphic
2881 Instruction Set, a graphics description language.
2882
2883 CSI Ps c Send Device Attributes (Primary DA), DEC graphics terminals,
2884 xterm. xterm responds to Send Device Attributes (Primary DA)
2885 with these additional codes:
2886 Ps = 3 -> ReGIS graphics.
2887
2888 CSI ? Pm h
2889 Set Mode, xterm. xterm has these additional private Set Mode
2890 values:
2891 Ps = 1 0 7 0 -> use private color registers for each
2892 graphic.
2893
2894 DCS Pm p Pr..Pr ST
2895 Enter or exit ReGIS, VT300, xterm. See:
2896
2897 VT330/VT340 Programmer Reference Manual Volume 2:
2898 Graphics Programming
2899 Chapter 1 Introduction to ReGIS
2900
2901 The ReGIS data device control string has one positional
2902 parameter with four possible values:
2903 Pm = 0 -> resume command, use fullscreen mode.
2904 Pm = 1 -> start new command, use fullscreen mode.
2905 Pm = 2 -> resume command, use command display mode.
2906 Pm = 3 -> start new command, use command display mode.
2907
2908
2909 Non-VT100 Modes
2910
2911
2912 Tektronix 4014 Mode
2913
2914 Most of these sequences are standard Tektronix 4014 control sequences.
2915 Graph mode supports the 12-bit addressing of the Tektronix 4014. The
2916 major features missing are the write-through and defocused modes. This
2917 document does not describe the commands used in the various Tektronix
2918 plotting modes but does describe the commands to switch modes.
2919
2920 Some of the sequences are specific to xterm. The Tektronix emulation
2921 was added in X10R4 (1986). The VT240, introduced two years earlier,
2922 also supported Tektronix 4010/4014. Unlike xterm, the VT240
2923 documentation implies (there is an obvious error in section 6.9
2924 "Entering and Exiting 4010/4014 Mode") that exiting back to ANSI mode is
2925 done by resetting private mode 3 8 (DECTEK) rather than ESC ETX . A
2926 real Tektronix 4014 would not respond to either.
2927
2928 BEL Bell (Ctrl-G).
2929
2930 BS Backspace (Ctrl-H).
2931
2932 TAB Horizontal Tab (Ctrl-I).
2933
2934 LF Line Feed or New Line (Ctrl-J).
2935
2936 VT Cursor up (Ctrl-K).
2937
2938 FF Form Feed or New Page (Ctrl-L).
2939
2940 CR Carriage Return (Ctrl-M).
2941
2942 ESC ETX Switch to VT100 Mode (ESC Ctrl-C).
2943
2944 ESC ENQ Return Terminal Status (ESC Ctrl-E).
2945
2946 ESC FF PAGE (Clear Screen) (ESC Ctrl-L).
2947
2948 ESC SO Begin 4015 APL mode (ESC Ctrl-N). This is ignored by xterm.
2949
2950 ESC SI End 4015 APL mode (ESC Ctrl-O). This is ignored by xterm.
2951
2952 ESC ETB COPY (Save Tektronix Codes to file COPYyyyy-mm-dd.hh:mm:ss).
2953 ETB (end transmission block) is the same as Ctrl-W.
2954
2955 ESC CAN Bypass Condition (ESC Ctrl-X).
2956
2957 ESC SUB GIN mode (ESC Ctrl-Z).
2958
2959 ESC FS Special Point Plot Mode (ESC Ctrl-\).
2960
2961 ESC 8 Select Large Character Set.
2962
2963 ESC 9 Select #2 Character Set.
2964
2965 ESC : Select #3 Character Set.
2966
2967 ESC ; Select Small Character Set.
2968
2969 OSC Ps ; Pt BEL
2970 Set Text Parameters of VT window.
2971 Ps = 0 -> Change Icon Name and Window Title to Pt.
2972 Ps = 1 -> Change Icon Name to Pt.
2973 Ps = 2 -> Change Window Title to Pt.
2974 Ps = 4 6 -> Change Log File to Pt. This is normally
2975 disabled by a compile-time option.
2976
2977 ESC ` Normal Z Axis and Normal (solid) Vectors.
2978
2979 ESC a Normal Z Axis and Dotted Line Vectors.
2980
2981 ESC b Normal Z Axis and Dot-Dashed Vectors.
2982
2983 ESC c Normal Z Axis and Short-Dashed Vectors.
2984
2985 ESC d Normal Z Axis and Long-Dashed Vectors.
2986
2987 ESC h Defocused Z Axis and Normal (solid) Vectors.
2988
2989 ESC i Defocused Z Axis and Dotted Line Vectors.
2990
2991 ESC j Defocused Z Axis and Dot-Dashed Vectors.
2992
2993 ESC k Defocused Z Axis and Short-Dashed Vectors.
2994
2995 ESC l Defocused Z Axis and Long-Dashed Vectors.
2996
2997 ESC p Write-Thru Mode and Normal (solid) Vectors.
2998
2999 ESC q Write-Thru Mode and Dotted Line Vectors.
3000
3001 ESC r Write-Thru Mode and Dot-Dashed Vectors.
3002
3003 ESC s Write-Thru Mode and Short-Dashed Vectors.
3004
3005 ESC t Write-Thru Mode and Long-Dashed Vectors.
3006
3007 FS Point Plot Mode (Ctrl-\).
3008
3009 GS Graph Mode (Ctrl-]).
3010
3011 RS Incremental Plot Mode (Ctrl-^ ).
3012
3013 US Alpha Mode (Ctrl-_).
3014
3015
3016 VT52 Mode
3017
3018 Parameters for cursor movement are at the end of the ESC Y escape
3019 sequence. Each ordinate is encoded in a single character as value+32.
3020 For example, ! is 1. The screen coordinate system is 0-based.
3021
3022 ESC < Exit VT52 mode (Enter VT100 mode).
3023
3024 ESC = Enter alternate keypad mode.
3025
3026 ESC > Exit alternate keypad mode.
3027
3028 ESC A Cursor up.
3029
3030 ESC B Cursor down.
3031
3032 ESC C Cursor right.
3033
3034 ESC D Cursor left.
3035
3036 ESC F Enter graphics mode.
3037
3038 ESC G Exit graphics mode.
3039
3040 ESC H Move the cursor to the home position.
3041
3042 ESC I Reverse line feed.
3043
3044 ESC J Erase from the cursor to the end of the screen.
3045
3046 ESC K Erase from the cursor to the end of the line.
3047
3048 ESC Y Ps Ps
3049 Move the cursor to given row and column.
3050
3051 ESC Z Identify.
3052 -> ESC / Z ("I am a VT52.").
3053
3054
3055 Further reading
3056
3057
3058 Technical manuals
3059
3060 Manuals for hardware terminals are more readily available than
3061 similarly-detailed documentation for terminal emulators such as aixterm,
3062 shelltool, dtterm.
3063
3064 However long, the technical manuals have problems:
3065
3066 o DEC's manuals did not provide a comprehensive comparison of the
3067 features in different model.
3068
3069 Peter Sichel's Host Interface Functions Checklist spreadsheet is
3070 useful for noting which model introduced a given feature (although
3071 there are a few apparent errors such as the DECRQSS feature cited
3072 for VT320 whereas the technical manual omits it).
3073
3074 o Sometimes the manuals disagree. For example, DEC's standard
3075 document (DEC STD 070) for terminals says that DECSCL performs a
3076 soft reset (DECSTR), while the VT420 manual says it does a hard
3077 reset (RIS).
3078
3079 o Sometimes the manuals are simply incorrect. For example, testing a
3080 DEC VT420 in 1996 showed that the documented code for a valid or
3081 invalid response to DECRQSS was reversed.
3082
3083 The VT420 test results were incorporated into the vttest program.
3084 At the time, DEC STD 070 was not available, but it also agrees with
3085 vttest. Later, documentation for the DEC VT525 was shown to have
3086 the same flaw.
3087
3088 o The VT330/VT340 reference manual for graphics programming documents
3089 sixel graphics in some detail in chapter 14. Overlooked in the
3090 first edition, the second edition mentions Sixel Scrolling. The
3091 VT382 Kanji and Thai manuals provide less information, about sixel
3092 graphics, but do mention DECSDM. They differ in their comment about
3093 the private mode DECSDM (CSI ? 8 0 h ), which each manual agrees
3094 should set the Sixel Scrolling feature. The VT330/VT340 graphics
3095 programming manual (second edition, March 1988) says
3096
3097 When sixel display mode is set, the Sixel Scrolling feature is
3098 enabled.
3099 When sixel display mode is reset, the Sixel Scrolling feature is
3100 disabled.
3101
3102 while the VT382 Kanji manual (page 6-6, undated) says
3103
3104 Disable sixel scroll
3105
3106 and the VT382 Thai manual (page C-30, August 1989) says
3107
3108 No Sixel scrolling
3109
3110 The standard (DEC STD 070) in chapter 9 (August 3, 1990) states on
3111 page 17 that video devices will scroll when advancing the Sixel
3112 active position past the bottom margin, but on page 19, in the
3113 section on deviations, states that VT125 and VT240 did not scroll in
3114 this situation. The standard does not mention VT330/VT340 or VT382.
3115 Nor does it document DECSDM.
3116
3117 o Not all details are clear even in DEC STD 070 (which is more than
3118 twice the length of the VT520 programmer's reference manual, and
3119 almost three times longer than the VT420 reference manual).
3120 However, as an internal standards document, DEC STD 070 is more
3121 likely to describe the actual behavior of DEC's terminals than the
3122 more polished user's guides.
3123
3124 That said, here are technical manuals which have been used in developing
3125 xterm. Not all were available initially. In August 1996 for instance,
3126 the technical references were limited to EK-VT220-HR-002 and EK-
3127 VT420-UG.002. Shortly after, Richard Shuford sent a copy of EK-VT3XX-
3128 TP-001. Still later (beginning in 2003), Paul Williams' vt100.net site
3129 provided EK-VT102-UG-003, EK-VT220-RM-002, EK-VT420-RM-002, EK-VT520-RM
3130 A01, EK-VT100-TM-003, and EK-VT102-UG-003. In addition, several
3131 documents were found on the bitsavers site.
3132
3133 o DECscope User's Manual.
3134 Digital Equipment Corporation (EK-VT5X-OP-001 1975).
3135
3136 o VT100 Series Video Terminal Technical Manual.
3137 Digital Equipment Corporation (EK-VT100-TM-003, July 1982).
3138
3139 o VT100 User Guide.
3140 Digital Equipment Corporation (EK-VT100-UG-003, June 1981).
3141
3142 o VT102 User Guide.
3143 Digital Equipment Corporation (EK-VT102-UG-003, February 1982).
3144
3145 o VT220 Programmer Pocket Guide.
3146 Digital Equipment Corporation (EK-VT220-HR-002, July 1984).
3147
3148 o VT220 Programmer Reference Manual.
3149 Digital Equipment Corporation (EK-VT220-RM-002, August 1984).
3150
3151 o VT240 Programmer Reference Manual.
3152 Digital Equipment Corporation (EK-VT240-RM-002, October 1984).
3153
3154 o VT330/VT340 Programmer Reference Manual
3155 Volume 1: Text Programming.
3156 Digital Equipment Corporation (EK-VT3XX-TP-001, March 1987).
3157
3158 o VT330/VT340 Programmer Reference Manual
3159 Volume 2: Graphics Programming.
3160 Digital Equipment Corporation (EK-VT3XX-GP-001, March 1987).
3161
3162 o VT330/VT340 Programmer Reference Manual
3163 Volume 2: Graphics Programming.
3164 Digital Equipment Corporation (EK-VT3XX-GP-002, May 1988).
3165
3166 o VT382 Kanji Display Terminal
3167 Programmer Reference Manual.
3168 Digital Equipment Corporation (EK-VT382-RM-001, undated).
3169
3170 o VT382 Thai Display Terminal
3171 Installing and Using Manual.
3172 Digital Equipment Corporation (EK-VT38T-UG-001, August 1989).
3173
3174 o Installing and Using
3175 The VT420 Video Terminal
3176 (North American Model).
3177 Digital Equipment Corporation (EK-VT420-UG.002, February 1990).
3178
3179 o VT420 Programmer Reference Manual.
3180 Digital Equipment Corporation (EK-VT420-RM-002, February 1992).
3181
3182 o VT510 Video Terminal
3183 Programmer Information.
3184 Digital Equipment Corporation (EK-VT510-RM B01, November 1993).
3185
3186 o VT520/VT525 Video Terminal
3187 Programmer Information.
3188 Digital Equipment Corporation (EK-VT520-RM A01, July 1994).
3189
3190 o Digital ANSI-Compliant Printing Protocol
3191 Level 2 Programming Reference Manual
3192 Digital Equipment Corporation (EK-PPLV2-PM B01, August 1994).
3193
3194 o Disk Operating System
3195 DOS 2.00
3196 Microsoft, Inc.
3197 First edition, January 1983.
3198
3199 o 4014 and 4014-1 Computer Display Terminal
3200 User's Manual.
3201 Tektronix, Inc. (070-1647-00, November 1979).
3202
3203
3204 Standards
3205
3206 The DEC terminal family (VT100 through VT525) is upward-compatible,
3207 using standards plus extensions, e.g., "private modes". Not all
3208 commonly-used features are standard. For example, scrolling regions are
3209 not found in ECMA-48. On the other hand, ECMA-48 was not intended to
3210 all-encompassing. Quoting from the second edition:
3211
3212 Full conformance to a standard means that all its requirements are
3213 met. For such conformance to be unique the standard must contain no
3214 options. This is typically the case for hardware standards, for
3215 instance Standard ECMA-10 for data interchange on punched tapes.
3216
3217 This Standard ECMA-48 is of a different nature and as a result, it
3218 is only practicable to envisage limited conformance to it, as
3219 defined hereunder.
3220
3221 This Standard addresses a whole class of devices which can vary
3222 greatly from each other depending on the application for which a
3223 device has been specifically designed. Obviously, a product which
3224 implements all facilities described in this standard - thus being in
3225 "full conformance" with it - whilst theoretically possible, would be
3226 technically and economically unthinkable.
3227
3228 Again, it is possible to find discrepancies in the standards:
3229
3230 o The printed ECMA-48 5th edition (1991) and the first PDF produced
3231 for that edition (April 1998) state that SD (scroll down) ends with
3232 05/14, i.e., ^ , which disagrees with DEC's VT420 hardware
3233 implementation and DEC's manuals which use 05/04 T . (A few other
3234 terminals such as AT&T 5620 and IBM 5151 also used 05/04, but the
3235 documentation and dates are lacking).
3236
3237 ECMA created a new PDF in April 2003 which changed that detail to
3238 use T , and later in 2008 provided PDFs of the earlier editions
3239 which used T .
3240
3241 o The first edition of ECMA-48 has not been available, to compare. As
3242 of September 2021, ECMA's website provides a copy of ECMA-46 in its
3243 place.
3244
3245 Earlier versions of ISO 6429 have never been available. The first
3246 three editions of ISO 6429 were issued in 1983, 1988, and 1992.
3247
3248 o ANSI X3.64-1979 does not list color as a feature of the SGR sequence
3249 (page 49).
3250
3251 In Appendix A, it mentions ECMA-48:
3252
3253 (8) This document represents a coordinated effort to develop a
3254 single technical standard in the United States and Europe (see
3255 ECMA-48 standard entitled Additional Controls for Character
3256 Imaging Input/Output Devices).
3257
3258 Appendix H clarifies the relationship between these documents
3259 somewhat though it confuses the first two editions of ECMA-48. The
3260 typo for "work" versus "owkr" appears in the original document:
3261
3262 ANSI X3.64-1979, and ECMA-48, Additional Controls for Character-
3263 Imaging I/O Devices, were developed in parallel, with close
3264 liaison. ISO DP 6429, Additional Control Functions for
3265 Character-Imaging Devices, was developed as a synthesis of X3.04
3266 and ECMA-48. During this process, some control functions as
3267 well as additional selective parameters were added. Except for
3268 point 1 below, X3.64 is a subset of ISO 6429. Although the two
3269 standards use different language, the intent is that the subset
3270 is technically identical. X3.64 was balloted and forwarded
3271 prior to the final resolution of ISO 6429 and does not
3272 incorporate the owkr of IS0/TC97/SC2 in completing ISO 6429.
3273 Revision of X3.64 will attempt to incorporate those elements and
3274 assumptions of X3.64.
3275
3276 ANSI X3.64 goes on to say that the SGR codes 8, 30-47 are in ISO
3277 6429. It includes 38 and 39, but omits 48 and 49. At the time, ISO
3278 6429's first edition was still four years in the future. The writer
3279 probably was referring to the ongoing process of making ECMA-48
3280 second edition into the ISO standard.
3281
3282 o The VT320, VT420, VT520 manuals claim that DECSCL does a hard reset
3283 (RIS).
3284
3285 Both the VT220 manual and DEC STD 070 (which documents levels 1-4 in
3286 detail) state that it is a soft reset, e.g., DECSTR.
3287
3288 Here are the relevant standards:
3289
3290 o Additional Controls for Use with American National Standard Code for
3291 Information Interchange, ANSI X3.64-1979
3292 FIPS Publication 86. July 18, 1979.
3293 American National Standards Institute, Inc.
3294
3295 o ECMA-35: Character Code Structure and Extension Techniques
3296 (6th Edition, December 1994).
3297
3298 o ECMA-43: 8-bit Coded Character Set Structure and Rules
3299 (3rd Edition, December 1991).
3300
3301 o ECMA-48: Control Functions for Coded Character Sets
3302 (5th Edition, June 1991).
3303
3304 o DEC STD 070 Video Systems Reference Manual.
3305 Digital Equipment Corporation (A-MN-ELSM070-00-0000 Rev H, December
3306 3, 1991).
3307
3308
3309 Miscellaneous
3310
3311 A few hardware terminals survived into the 1990s only as terminal
3312 emulators. Documentation for these and other terminal emulators which
3313 have influenced xterm are generally available only in less-accessible
3314 and less-detailed manual pages.
3315
3316 o XTerm supports control sequences for manipulating its window which
3317 were implemented by Sun's shelltool program. This was part of
3318 SunView (SunOS 3.0, 1986). The change-notes for xterm's resize
3319 program in X10.4 (1986) mention its use of these "Sun tty emulation
3320 escape sequences" for resizing the window. The X10.4 xterm program
3321 recognized these sequences for resizing the terminal, except for the
3322 iconify/deiconify pair. SunView also introduced the SIGWINCH
3323 signal, used by the X10.4 xterm and mentioned in its CHANGES file:
3324
3325 The window size is passed to the operating system via TIOCSWINSZ
3326 (4.3) or TIOCSSIZE (sun). A SIGWINCH signal is sent if the
3327 vtXXX window is resized.
3328
3329 While support for the Sun control-sequences remained in resize, the
3330 next release of xterm (X11R1 in 1987) omitted the code for
3331 interpreting them.
3332
3333 Later, the SunView program was adapted for the OPEN LOOK environment
3334 introduced 1988-1990.
3335
3336 Still later, in 1995, OPEN LOOK was abandoned in favor of CDE. The
3337 CDE terminal emulator dtterm implemented those controls, with a
3338 couple of additions.
3339
3340 Starting in July 1996, xterm re-implemented those control sequences
3341 (based on the dtterm manual pages) and further extended the group of
3342 window controls.
3343
3344 There were two sets of controls (CSI Ps [ ; Pm ; Pm ] t , and OSC Ps
3345 text ST ) implemented by shelltool, documented in appendix E of both
3346 PHIGS Programming Manual (1992), and the unpublished X Window System
3347 User's Guide (OPEN LOOK Edition) (1995). The CDE program kept
3348 those, and added a few new ones.
3349
3350 Code Sun CDE XTerm Description
3351 -----------+-----+-----+-------+---------------------------------
3352 CSI 1 t | yes | yes | yes | de-iconify
3353 CSI 2 t | yes | yes | yes | iconify
3354 CSI 3 t | yes | yes | yes | move window to pixel-position
3355 CSI 4 t | yes | yes | yes | resize window in pixels
3356 CSI 5 t | yes | yes | yes | raise window to front of stack
3357 CSI 6 t | yes | yes | yes | raise window to back of stack
3358 CSI 7 t | yes | yes | yes | refresh window
3359 CSI 8 t | yes | yes | yes | resize window in chars
3360 CSI 9 t | - | - | yes | maximize/unmaximize window
3361 CSI 1 0 t | - | - | yes | to/from full-screen
3362 CSI 1 1 t | yes | yes | yes | report if window is iconified
3363 CSI 1 2 t | - | - | - | -
3364 CSI 1 3 t | yes | yes | yes | report window position
3365 CSI 1 4 t | yes | yes | yes | report window size in pixels
3366 CSI 1 5 t | - | - | yes | report screen size in pixels
3367 CSI 1 6 t | - | - | yes | report character cell in pixels
3368 CSI 1 7 t | - | - | - | -
3369 CSI 1 8 t | yes | yes | yes | report window size in chars
3370 CSI 1 9 t | - | - | yes | report screen size in chars
3371 CSI 2 0 t | - | yes | yes | report icon label
3372 CSI 2 1 t | - | yes | yes | report window title
3373 CSI 2 2 t | - | - | yes | save window/icon title
3374 CSI 2 3 t | - | - | yes | restore window/icon title
3375 CSI 2 4 t | - | - | yes | resize window (DECSLPP)
3376 OSC 0 ST | - | yes | yes | set window and icon title
3377 OSC 1 ST | - | yes | yes | set icon label
3378 OSC 2 ST | - | yes | yes | set window title
3379 OSC 3 ST | - | n/a | yes | set X server property
3380 OSC I ST | yes | yes | yes | set icon to file
3381 OSC l ST | yes | yes | yes | set window title
3382 OSC L ST | yes | yes | yes | set icon label
3383 -----------+-----+-----+-------+---------------------------------
3384
3385 Besides the Sun-derived OSC controls for setting window title and
3386 icon label, dtterm also supported the xterm controls for the same
3387 feature.
3388
3389 The CDE source was unavailable for inspection until 2012, so that
3390 clarification of the details of the window operations relied upon
3391 vttest.
3392
3393 o The SCOSC/SCORC control sequences for saving/restoring the cursor
3394 and for saving/restoring "DEC Private Mode Values" (XTSAVE and
3395 XTRESTORE) may appear to be related (since the "save" controls both
3396 end with s ), but that is coincidental. The latter was introduced
3397 in X10.4 (December 1986):
3398
3399 Most Dec Private mode settings can be saved away internally
3400 using \E[?ns, where n is the same number to set or reset the Dec
3401 Private mode. The mode can be restored using \E[?nr. This can
3402 be used in termcap for vi, for example, to turn off saving of
3403 lines, but restore whatever the original state was on exit.
3404
3405 while the SCOSC/SCORC pair was added in 1995 by XFree86 (and
3406 documented long afterwards).
3407
3408 The SCO ANSI console terminal descriptions did not use these
3409 controls (they used the VT100-compatible SC/RC pair). SCOSC/SCORC
3410 were an artifact of DOS 2.00 (January 1983), by Microsoft and later
3411 supported by SCO and other vendors.
3412
3413 The SCOSC/SCORC pair is considered a private mode because the final
3414 characters (s and u ) fall in the range from "`" to "~" (octal 0140
3415 to octal 0176). Other private control sequences can be constructed
3416 by using octets 074 to 077 (characters "<", "=", ">", or "?") at the
3417 beginning of the parameter string. The XTSAVE and XTRESTORE
3418 controls use "?") in this manner.
3419
3420 Because the XTSAVE and XTRESTORE controls are private, other
3421 terminals may behave differently. For example, DEC (a contributor
3422 to the early xterm as well as a manufacturer of terminals) used an
3423 incompatible private control in one of its terminals more than five
3424 years later (for the VT420 PCTerm, announced in February 1992).
3425
3426 In that model of the VT420, CSI ? Pm; Pc r selects the PC TERM
3427 emulation mode. When this mode is enabled, the keyboard sends scan
3428 codes rather than characters (analogous to X keyboard events). The
3429 first parameter of this private control enables or disables PC TERM
3430 mode, while the second selects a character set. An ambiguity arises
3431 if an application omits the second parameter. In that special case,
3432 it cannot be distinguished from XTRESTORE. DEC did not take this
3433 into account when designing the feature.
3434
3435 If there were potential users, xterm could accommodate this by a
3436 resource setting. In retrospect (thirty years later), there have
3437 been no uses of PC TERM, while the XTRESTORE feature is still in
3438 use.
3439
3440 o The aixterm manual page gives the format of the control sequence for
3441 foreground and background colors 8-15, but does not specify what
3442 those colors are. That is implied by the description's mention of
3443 HFT:
3444
3445 The aixterm command provides a standard terminal type for
3446 programs that do not interact directly with Enhanced X-Windows.
3447 This command provides an emulation for a VT102 terminal or a
3448 high function terminal (HFT). The VT102 mode is activated by
3449 the -v flag.
3450
3451 Unlike xterm, there are no resource names for the 16 colors, leaving
3452 the reader to assume that the mapping is hard-coded. The control
3453 sequences for colors 8-15 are not specified by ECMA-48, but rather
3454 (as done in other instances by xterm) chosen to not conflict with
3455 current or future standards.