-
Notifications
You must be signed in to change notification settings - Fork 17
/
ctlseqs.txt
3337 lines (2632 loc) · 137 KB
/
ctlseqs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
Stephen Gildea
X Consortium (1994)
Thomas Dickey
XFree86 Project (1996-2006)
invisible-island.net (2006-2022)
updated for XTerm Patch #373 (2022/03/12)
Definitions
Many controls use parameters, shown in italics. If a control uses a
single parameter, only one parameter name is listed. Some parameters
(along with separating ; characters) may be optional. Other characters
in the control are required.
C A single (required) character.
Ps A single (usually optional) numeric parameter, composed of one or
more digits.
Pm Any number of single numeric parameters, separated by ;
character(s). Individual values for the parameters are listed with
Ps .
Pt A text parameter composed of printable characters.
Control Bytes, Characters, and Sequences
ECMA-48 (aka "ISO 6429") documents C1 (8-bit) and C0 (7-bit) codes.
Those are respectively codes 128 to 159 and 0 to 31. ECMA-48 avoids
referring to these codes as characters, because that term is associated
with graphic characters. Instead, it uses "bytes" and "codes", with
occasional lapses to "characters" where the meaning cannot be mistaken.
Controls (including the escape code 27) are processed once:
o This means that a C1 control can be mistaken for badly-formed UTF-8
when the terminal runs in UTF-8 mode because C1 controls are valid
continuation bytes of a UTF-8 encoded (multibyte) value.
o It is not possible to use a C1 control obtained from decoding the
UTF-8 text, because that would require reprocessing the data.
Consequently there is no ambiguity in the way this document uses the
term "character" to refer to bytes in a control sequence.
The order of processing is a necessary consequence of the way ECMA-48 is
designed:
o Each byte sent to the terminal can be unambiguously determined to
fall into one of a few categories (C0, C1 and graphic characters).
o ECMA-48 is modal; once it starts processing a control sequence, the
terminal continues until the sequence is complete, or some byte is
found which is not allowed in the sequence.
o Intermediate, parameter and final bytes may use the same codes as
graphic characters, but they are processed as part of a control
sequence and are not actually graphic characters.
o Eight-bit controls can have intermediate, etc., bytes in the range
160 to 255. Those can be treated as their counterparts in the range
32 to 127.
o Single-byte controls can be handled separately from multi-byte
control sequences because ECMA-48's rules are unambiguous.
As a special case, ECMA-48 (section 9) mentions that the control
functions shift-in and shift-out are allowed to occur within a 7-bit
multibyte control sequence because those cannot alter the meaning of
the control sequence.
o Some controls (such as OSC ) introduce a string mode, which is ended
on a ST (string terminator).
ECMA-48 describes only correct behavior, telling what types of
characters are expected at each stage of the control sequences. It
says that the action taken in error recovery is implementation-
dependent. XTerm decodes control sequences using a state machine.
It handles errors in decoding i.e., unexpected characters, by
resetting to the initial (ground) state. That is different from the
treatment of unimplemented (but correctly formatted) features.
If an application does not send the string terminator, that is also
an error from the standpoint of a user. To accommodate users of
those applications, xterm has resource settings which allow
workarounds:
o The Linux console's palette sequences do not use a string
terminator. The brokenLinuxOSC resource setting tells xterm to
ignore those particular sequences.
o The terminal should accept single-byte controls within the
string. But some applications omit a string terminator, like
the Linux console. The brokenStringTerm resource setting tells
xterm to exit string mode if it decodes a common control
character such as carriage return before the string terminator.
C1 (8-Bit) Control Characters
The xterm program recognizes both 8-bit and 7-bit control characters.
It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
The following pairs of 7-bit and 8-bit control characters are
equivalent:
ESC D
Index (IND is 0x84).
ESC E
Next Line (NEL is 0x85).
ESC H
Tab Set (HTS is 0x88).
ESC M
Reverse Index (RI is 0x8d).
ESC N
Single Shift Select of G2 Character Set (SS2 is 0x8e), VT220.
This affects next character only.
ESC O
Single Shift Select of G3 Character Set (SS3 is 0x8f), VT220.
This affects next character only.
ESC P
Device Control String (DCS is 0x90).
ESC V
Start of Guarded Area (SPA is 0x96).
ESC W
End of Guarded Area (EPA is 0x97).
ESC X
Start of String (SOS is 0x98).
ESC Z
Return Terminal ID (DECID is 0x9a). Obsolete form of CSI c (DA).
ESC [
Control Sequence Introducer (CSI is 0x9b).
ESC \
String Terminator (ST is 0x9c).
ESC ]
Operating System Command (OSC is 0x9d).
ESC ^
Privacy Message (PM is 0x9e).
ESC _
Application Program Command (APC is 0x9f).
These control characters are used in the vtXXX emulation.
VT100-related terminals
In this document, "VT100" refers not only to VT100/VT102, but also to
the succession of upward-compatible terminals produced by DEC (Digital
Equipment Corporation) from the mid-1970s for about twenty years. For
brevity, the document refers to the related models:
"VT200" as VT220/VT240,
"VT300" as VT320/VT340,
"VT400" as VT420, and
"VT500" as VT510/VT520/VT525.
Most of these control sequences are standard VT102 control sequences,
but there is support for later DEC VT terminals (i.e., VT220, VT320,
VT420, VT510), as well as ECMA-48 and aixterm color controls. The only
VT102 feature not supported is auto-repeat, since the only way X
provides for this will affect all windows.
There are additional control sequences to provide xterm-dependent
functions, such as the scrollbar or window size. Where the function is
specified by DEC or ECMA-48, the mnemonic assigned to it is given in
parentheses.
The escape codes to designate and invoke character sets are specified by
ISO 2022 (see that document for a discussion of character sets).
Many of the features are optional; xterm can be configured and built
without support for them.
VT100 Mode
Single-character functions
BEL Bell (BEL is Ctrl-G).
BS Backspace (BS is Ctrl-H).
CR Carriage Return (CR is Ctrl-M).
ENQ Return Terminal Status (ENQ is Ctrl-E). Default response is
an empty string, but may be overridden by a resource
answerbackString.
FF Form Feed or New Page (NP ). (FF is Ctrl-L). FF is treated
the same as LF .
LF Line Feed or New Line (NL). (LF is Ctrl-J).
SI Switch to Standard Character Set (Ctrl-O is Shift In or LS0).
This invokes the G0 character set (the default) as GL.
VT200 and up implement LS0.
SO Switch to Alternate Character Set (Ctrl-N is Shift Out or
LS1). This invokes the G1 character set as GL.
VT200 and up implement LS1.
SP Space.
TAB Horizontal Tab (HTS is Ctrl-I).
VT Vertical Tab (VT is Ctrl-K). This is treated the same as LF.
Controls beginning with ESC
This excludes controls where ESC is part of a 7-bit equivalent to 8-bit
C1 controls, ordered by the final character(s).
ESC SP F 7-bit controls (S7C1T), VT220. This tells the terminal to
send C1 control characters as 7-bit sequences, e.g., its
responses to queries. DEC VT200 and up always accept 8-bit
control sequences except when configured for VT100 mode.
ESC SP G 8-bit controls (S8C1T), VT220. This tells the terminal to
send C1 control characters as 8-bit sequences, e.g., its
responses to queries. DEC VT200 and up always accept 8-bit
control sequences except when configured for VT100 mode.
ESC SP L Set ANSI conformance level 1, ECMA-43.
ESC SP M Set ANSI conformance level 2, ECMA-43.
ESC SP N Set ANSI conformance level 3, ECMA-43.
ESC # 3 DEC double-height line, top half (DECDHL), VT100.
ESC # 4 DEC double-height line, bottom half (DECDHL), VT100.
ESC # 5 DEC single-width line (DECSWL), VT100.
ESC # 6 DEC double-width line (DECDWL), VT100.
ESC # 8 DEC Screen Alignment Test (DECALN), VT100.
ESC % @ Select default character set. That is ISO 8859-1 (ISO 2022).
ESC % G Select UTF-8 character set, ISO 2022.
ESC ( C Designate G0 Character Set, VT100, ISO 2022.
Final character C for designating 94-character sets. In this
list,
o 0 , A and B were introduced in the VT100,
o most were introduced in the VT200 series,
o a few were introduced in the VT300 series, and
o a few more were introduced in the VT500 series.
The VT220 character sets, together with a few others (such as
Portuguese) are activated by the National Replacement
Character Set (NRCS) controls. The term "replacement" says
that the character set is formed by replacing some of the
characters in a set (termed the Multinational Character Set)
with more useful ones for a given language. The ASCII and DEC
Supplemental character sets make up the two halves of the
Multinational Character set, initially mapped to GL and GR.
The valid final characters C for this control are:
C = A -> United Kingdom (UK), VT100.
C = B -> United States (USASCII), VT100.
C = C or 5 -> Finnish, VT200.
C = H or 7 -> Swedish, VT200.
C = K -> German, VT200.
C = Q or 9 -> French Canadian, VT200.
C = R or f -> French, VT200.
C = Y -> Italian, VT200.
C = Z -> Spanish, VT200.
C = 4 -> Dutch, VT200.
C = " > -> Greek, VT500.
C = % 2 -> Turkish, VT500.
C = % 6 -> Portuguese, VT300.
C = % = -> Hebrew, VT500.
C = = -> Swiss, VT200.
C = ` , E or 6 -> Norwegian/Danish, VT200.
The final character A is a special case, since the same final
character is used by the VT300-control for the 96-character
British Latin-1.
There are a few other 94-character sets:
C = 0 -> DEC Special Character and Line Drawing Set, VT100.
C = < -> DEC Supplemental, VT200.
C = > -> DEC Technical, VT300.
These are documented as 94-character sets (like USASCII)
without NRCS:
C = " 4 -> DEC Hebrew, VT500.
C = " ? -> DEC Greek, VT500.
C = % 0 -> DEC Turkish, VT500.
C = % 5 -> DEC Supplemental Graphics, VT300.
C = & 4 -> DEC Cyrillic, VT500.
The VT520 reference manual lists a few more, but no
documentation has been found for the mappings:
C = % 3 -> SCS NRCS, VT500.
C = & 5 -> DEC Russian, VT500.
ESC ) C Designate G1 Character Set, ISO 2022, VT100.
The same character sets apply as for ESC ( C.
ESC * C Designate G2 Character Set, ISO 2022, VT220.
The same character sets apply as for ESC ( C.
ESC + C Designate G3 Character Set, ISO 2022, VT220.
The same character sets apply as for ESC ( C.
ESC - C Designate G1 Character Set, VT300.
These controls apply only to 96-character sets. Unlike the
94-character sets, these can have different values than ASCII
space and DEL for the mapping of 0x20 and 0x7f. The valid
final characters C for this control are:
C = A -> ISO Latin-1 Supplemental, VT300.
C = B -> ISO Latin-2 Supplemental, VT500.
C = F -> ISO Greek Supplemental, VT500.
C = H -> ISO Hebrew Supplemental, VT500.
C = L -> ISO Latin-Cyrillic, VT500.
C = M -> ISO Latin-5 Supplemental, VT500.
ESC . C Designate G2 Character Set, VT300.
The same character sets apply as for ESC - C.
ESC / C Designate G3 Character Set, VT300.
The same character sets apply as for ESC - C.
ESC 6 Back Index (DECBI), VT420 and up.
ESC 7 Save Cursor (DECSC), VT100.
ESC 8 Restore Cursor (DECRC), VT100.
ESC 9 Forward Index (DECFI), VT420 and up.
ESC = Application Keypad (DECKPAM).
ESC > Normal Keypad (DECKPNM), VT100.
ESC F Cursor to lower left corner of screen. This is enabled by the
hpLowerleftBugCompat resource.
ESC c Full Reset (RIS), VT100.
ESC l Memory Lock (per HP terminals). Locks memory above the
cursor.
ESC m Memory Unlock (per HP terminals).
ESC n Invoke the G2 Character Set as GL (LS2).
ESC o Invoke the G3 Character Set as GL (LS3).
ESC | Invoke the G3 Character Set as GR (LS3R).
ESC } Invoke the G2 Character Set as GR (LS2R).
ESC ~ Invoke the G1 Character Set as GR (LS1R), VT100.
Application Program-Command functions
APC Pt ST None. xterm implements no APC functions; Pt is ignored. Pt
need not be printable characters.
Device-Control functions
DCS Ps ; Ps | Pt ST
User-Defined Keys (DECUDK), VT220 and up.
The first parameter:
Ps = 0 -> Clear all UDK definitions before starting
(default).
Ps = 1 -> Erase Below (default).
The second parameter:
Ps = 0 <- Lock the keys (default).
Ps = 1 <- Do not lock.
The third parameter is a ";"-separated list of strings
denoting the key-code separated by a "/" from the hex-encoded
key value. The key codes correspond to the DEC function-key
codes (e.g., F6=17).
DCS $ q Pt ST
Request Status String (DECRQSS), VT420 and up.
The string following the "q" is one of the following:
m -> SGR
" p -> DECSCL
SP q -> DECSCUSR
" q -> DECSCA
r -> DECSTBM
s -> DECSLRM
t -> DECSLPP
$ | -> DECSCPP
$ } -> DECSASD
$ ~ -> DECSSDT
* | -> DECSNLS
xterm responds with DCS 1 $ r Pt ST for valid requests,
replacing the Pt with the corresponding CSI string, or DCS 0 $
r Pt ST for invalid requests.
DCS Ps $ t Pt ST
Restore presentation status (DECRSPS), VT320 and up. The
control can be converted from a response from DECCIR or
DECTABSR by changing the first "u" to a "t"
Ps = 1 -> DECCIR
Ps = 2 -> DECTABSR
DCS + Q Pt ST
Request resource values (XTGETXRES), xterm. The string
following the "Q" is a list of names encoded in hexadecimal (2
digits per character) separated by ; which correspond to xterm
resource names. Only boolean, numeric and string resources
are supported by this query.
xterm responds with
DCS 1 + R Pt ST for valid requests, adding to Pt an = , and
the value of the corresponding resource that xterm is using,
or
DCS 0 + R Pt ST for invalid requests.
The strings are encoded in hexadecimal (2 digits per
character).
DCS + p Pt ST
Set Termcap/Terminfo Data (XTSETTCAP), xterm. The string
following the "p" is a name to use for retrieving data from
the terminal database. The data will be used for the "tcap"
keyboard configuration's function- and special-keys, as well
as by the Request Termcap/Terminfo String control.
DCS + q Pt ST
Request Termcap/Terminfo String (XTGETTCAP), xterm. The
string following the "q" is a list of names encoded in
hexadecimal (2 digits per character) separated by ; which
correspond to termcap or terminfo key names.
A few special features are also recognized, which are not key
names:
o Co for termcap colors (or colors for terminfo colors), and
o TN for termcap name (or name for terminfo name).
o RGB for the ncurses direct-color extension.
Only a terminfo name is provided, since termcap
applications cannot use this information.
xterm responds with
DCS 1 + r Pt ST for valid requests, adding to Pt an = , and
the value of the corresponding string that xterm would send,
or
DCS 0 + r Pt ST for invalid requests.
The strings are encoded in hexadecimal (2 digits per
character).
Functions using CSI , ordered by the final character(s)
CSI Ps @ Insert Ps (Blank) Character(s) (default = 1) (ICH).
CSI Ps SP @
Shift left Ps columns(s) (default = 1) (SL), ECMA-48.
CSI Ps A Cursor Up Ps Times (default = 1) (CUU).
CSI Ps SP A
Shift right Ps columns(s) (default = 1) (SR), ECMA-48.
CSI Ps B Cursor Down Ps Times (default = 1) (CUD).
CSI Ps C Cursor Forward Ps Times (default = 1) (CUF).
CSI Ps D Cursor Backward Ps Times (default = 1) (CUB).
CSI Ps E Cursor Next Line Ps Times (default = 1) (CNL).
CSI Ps F Cursor Preceding Line Ps Times (default = 1) (CPL).
CSI Ps G Cursor Character Absolute [column] (default = [row,1]) (CHA).
CSI Ps ; Ps H
Cursor Position [row;column] (default = [1,1]) (CUP).
CSI Ps I Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).
CSI Ps J Erase in Display (ED), VT100.
Ps = 0 -> Erase Below (default).
Ps = 1 -> Erase Above.
Ps = 2 -> Erase All.
Ps = 3 -> Erase Saved Lines, xterm.
CSI ? Ps J
Erase in Display (DECSED), VT220.
Ps = 0 -> Selective Erase Below (default).
Ps = 1 -> Selective Erase Above.
Ps = 2 -> Selective Erase All.
Ps = 3 -> Selective Erase Saved Lines, xterm.
CSI Ps K Erase in Line (EL), VT100.
Ps = 0 -> Erase to Right (default).
Ps = 1 -> Erase to Left.
Ps = 2 -> Erase All.
CSI ? Ps K
Erase in Line (DECSEL), VT220.
Ps = 0 -> Selective Erase to Right (default).
Ps = 1 -> Selective Erase to Left.
Ps = 2 -> Selective Erase All.
CSI Ps L Insert Ps Line(s) (default = 1) (IL).
CSI Ps M Delete Ps Line(s) (default = 1) (DL).
CSI Ps P Delete Ps Character(s) (default = 1) (DCH).
CSI # P
CSI Pm # P
Push current dynamic- and ANSI-palette colors onto stack
(XTPUSHCOLORS), xterm. Parameters (integers in the range 1
through 10, since the default 0 will push) may be used to
store the palette into the stack without pushing.
CSI # Q
CSI Pm # Q
Pop stack to set dynamic- and ANSI-palette colors
(XTPOPCOLORS), xterm. Parameters (integers in the range 1
through 10, since the default 0 will pop) may be used to
restore the palette from the stack without popping.
CSI # R Report the current entry on the palette stack, and the number
of palettes stored on the stack, using the same form as
XTPOPCOLOR (default = 0) (XTREPORTCOLORS), xterm.
CSI Ps S Scroll up Ps lines (default = 1) (SU), VT420, ECMA-48.
CSI ? Pi ; Pa ; Pv S
Set or request graphics attribute (XTSMGRAPHICS), xterm. If
configured to support either Sixel Graphics or ReGIS Graphics,
xterm accepts a three-parameter control sequence, where Pi, Pa
and Pv are the item, action and value:
Pi = 1 -> item is number of color registers.
Pi = 2 -> item is Sixel graphics geometry (in pixels).
Pi = 3 -> item is ReGIS graphics geometry (in pixels).
Pa = 1 -> read attribute.
Pa = 2 -> reset to default.
Pa = 3 -> set to value in Pv.
Pa = 4 -> read the maximum allowed value.
Pv is ignored by xterm except when setting (Pa == 3 ).
Pv = n <- A single integer is used for color registers.
Pv = width ; height <- Two integers for graphics geometry.
xterm replies with a control sequence of the same form:
CSI ? Pi ; Ps ; Pv S
where Ps is the status:
Ps = 0 <- success.
Ps = 1 <- error in Pi.
Ps = 2 <- error in Pa.
Ps = 3 <- failure.
On success, Pv represents the value read or set.
Notes:
o The current implementation allows reading the graphics
sizes, but disallows modifying those sizes because that is
done once, using resource-values.
o Graphics geometry is not necessarily the same as "window
size" (see the dtterm window manipulation extensions).
XTerm limits the maximum graphics geometry according to
the maxGraphicSize resource.
The maxGraphicSize resource can be either an explicit
heightxwidth (default: 1000x1000 as of version 328) or the
word "auto" (telling XTerm to use limits the decGraphicsID
or decTerminalID resource to determine the limits).
o XTerm uses the minimum of the window size and the graphic
size to obtain the maximum geometry.
o While resizing a window will always change the current
graphics geometry, the reverse is not true. Setting
graphics geometry does not affect the window size.
o If xterm is able to support graphics (compile-time), but
is not configured (runtime) for graphics, these responses
will indicate a failure. Other implementations which do
not use the maximum graphics dimensions but are configured
for graphics should report zeroes for the maximum geometry
rather than a failure.
CSI Ps T Scroll down Ps lines (default = 1) (SD), VT420.
CSI Ps ; Ps ; Ps ; Ps ; Ps T
Initiate highlight mouse tracking (XTHIMOUSE), xterm.
Parameters are [func;startx;starty;firstrow;lastrow]. See the
section Mouse Tracking.
CSI > Pm T
Reset title mode features to default value (XTRMTITLE), xterm.
Normally, "reset" disables the feature. It is possible to
disable the ability to reset features by compiling a different
default for the title modes into xterm.
Ps = 0 -> Do not set window/icon labels using hexadecimal.
Ps = 1 -> Do not query window/icon labels using
hexadecimal.
Ps = 2 -> Do not set window/icon labels using UTF-8.
Ps = 3 -> Do not query window/icon labels using UTF-8.
(See discussion of Title Modes).
CSI Ps X Erase Ps Character(s) (default = 1) (ECH).
CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).
CSI Ps ^ Scroll down Ps lines (default = 1) (SD), ECMA-48.
This was a publication error in the original ECMA-48 5th
edition (1991) corrected in 2003.
CSI Ps ` Character Position Absolute [column] (default = [row,1])
(HPA).
CSI Ps a Character Position Relative [columns] (default = [row,col+1])
(HPR).
CSI Ps b Repeat the preceding graphic character Ps times (REP).
CSI Ps c Send Device Attributes (Primary DA).
Ps = 0 or omitted -> request attributes from terminal. The
response depends on the decTerminalID resource setting.
-> CSI ? 1 ; 2 c ("VT100 with Advanced Video Option")
-> CSI ? 1 ; 0 c ("VT101 with No Options")
-> CSI ? 4 ; 6 c ("VT132 with Advanced Video and Graphics")
-> CSI ? 6 c ("VT102")
-> CSI ? 7 c ("VT131")
-> CSI ? 1 2 ; Ps c ("VT125")
-> CSI ? 6 2 ; Ps c ("VT220")
-> CSI ? 6 3 ; Ps c ("VT320")
-> CSI ? 6 4 ; Ps c ("VT420")
The VT100-style response parameters do not mean anything by
themselves. VT220 (and higher) parameters do, telling the
host what features the terminal supports:
Ps = 1 -> 132-columns.
Ps = 2 -> Printer.
Ps = 3 -> ReGIS graphics.
Ps = 4 -> Sixel graphics.
Ps = 6 -> Selective erase.
Ps = 8 -> User-defined keys.
Ps = 9 -> National Replacement Character sets.
Ps = 1 5 -> Technical characters.
Ps = 1 6 -> Locator port.
Ps = 1 7 -> Terminal state interrogation.
Ps = 1 8 -> User windows.
Ps = 2 1 -> Horizontal scrolling.
Ps = 2 2 -> ANSI color, e.g., VT525.
Ps = 2 8 -> Rectangular editing.
Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).
XTerm supports part of the User windows feature, providing a
single page (which corresponds to its visible window). Rather
than resizing the font to change the number of lines/columns
in a fixed-size display, xterm uses the window extension
controls (DECSNLS, DECSCPP, DECSLPP) to adjust its visible
window's size. The "cursor coupling" controls (DECHCCM,
DECPCCM, DECVCCM) are ignored.
CSI = Ps c
Send Device Attributes (Tertiary DA).
Ps = 0 -> report Terminal Unit ID (default), VT400. XTerm
uses zeros for the site code and serial number in its DECRPTUI
response.
CSI > Ps c
Send Device Attributes (Secondary DA).
Ps = 0 or omitted -> request the terminal's identification
code. The response depends on the decTerminalID resource
setting. It should apply only to VT220 and up, but xterm
extends this to VT100.
-> CSI > Pp ; Pv ; Pc c
where Pp denotes the terminal type
Pp = 0 -> "VT100".
Pp = 1 -> "VT220".
Pp = 2 -> "VT240" or "VT241".
Pp = 1 8 -> "VT330".
Pp = 1 9 -> "VT340".
Pp = 2 4 -> "VT320".
Pp = 3 2 -> "VT382".
Pp = 4 1 -> "VT420".
Pp = 6 1 -> "VT510".
Pp = 6 4 -> "VT520".
Pp = 6 5 -> "VT525".
and Pv is the firmware version (for xterm, this was originally
the XFree86 patch number, starting with 95). In a DEC
terminal, Pc indicates the ROM cartridge registration number
and is always zero.
CSI Ps d Line Position Absolute [row] (default = [1,column]) (VPA).
CSI Ps e Line Position Relative [rows] (default = [row+1,column])
(VPR).
CSI Ps ; Ps f
Horizontal and Vertical Position [row;column] (default =
[1,1]) (HVP).
CSI Ps g Tab Clear (TBC).
Ps = 0 -> Clear Current Column (default).
Ps = 3 -> Clear All.
CSI Pm h Set Mode (SM).
Ps = 2 -> Keyboard Action Mode (KAM).
Ps = 4 -> Insert Mode (IRM).
Ps = 1 2 -> Send/receive (SRM).
Ps = 2 0 -> Automatic Newline (LNM).
CSI ? Pm h
DEC Private Mode Set (DECSET).
Ps = 1 -> Application Cursor Keys (DECCKM), VT100.
Ps = 2 -> Designate USASCII for character sets G0-G3
(DECANM), VT100, and set VT100 mode.
Ps = 3 -> 132 Column Mode (DECCOLM), VT100.
Ps = 4 -> Smooth (Slow) Scroll (DECSCLM), VT100.
Ps = 5 -> Reverse Video (DECSCNM), VT100.
Ps = 6 -> Origin Mode (DECOM), VT100.
Ps = 7 -> Auto-Wrap Mode (DECAWM), VT100.
Ps = 8 -> Auto-Repeat Keys (DECARM), VT100.
Ps = 9 -> Send Mouse X & Y on button press. See the
section Mouse Tracking. This is the X10 xterm mouse protocol.
Ps = 1 0 -> Show toolbar (rxvt).
Ps = 1 2 -> Start blinking cursor (AT&T 610).
Ps = 1 3 -> Start blinking cursor (set only via resource or
menu).
Ps = 1 4 -> Enable XOR of blinking cursor control sequence
and menu.
Ps = 1 8 -> Print Form Feed (DECPFF), VT220.
Ps = 1 9 -> Set print extent to full screen (DECPEX),
VT220.
Ps = 2 5 -> Show cursor (DECTCEM), VT220.
Ps = 3 0 -> Show scrollbar (rxvt).
Ps = 3 5 -> Enable font-shifting functions (rxvt).
Ps = 3 8 -> Enter Tektronix mode (DECTEK), VT240, xterm.
Ps = 4 0 -> Allow 80 -> 132 mode, xterm.
Ps = 4 1 -> more(1) fix (see curses resource).
Ps = 4 2 -> Enable National Replacement Character sets
(DECNRCM), VT220.
Ps = 4 3 -> Enable Graphics Expanded Print Mode (DECGEPM).
Ps = 4 4 -> Turn on margin bell, xterm.
Ps = 4 4 -> Enable Graphics Print Color Mode (DECGPCM).
Ps = 4 5 -> Reverse-wraparound mode, xterm.
Ps = 4 5 -> Enable Graphics Print ColorSpace (DECGPCS).
Ps = 4 6 -> Start logging, xterm. This is normally
disabled by a compile-time option.
Ps = 4 7 -> Use Alternate Screen Buffer, xterm. This may
be disabled by the titeInhibit resource.
Ps = 4 7 -> Enable Graphics Rotated Print Mode (DECGRPM).
Ps = 6 6 -> Application keypad mode (DECNKM), VT320.
Ps = 6 7 -> Backarrow key sends backspace (DECBKM), VT340,
VT420. This sets the backarrowKey resource to "true".
Ps = 6 9 -> Enable left and right margin mode (DECLRMM),
VT420 and up.
Ps = 8 0 -> Disable Sixel Scrolling (DECSDM).
Ps = 9 5 -> Do not clear screen when DECCOLM is set/reset
(DECNCSM), VT510 and up.
Ps = 1 0 0 0 -> Send Mouse X & Y on button press and
release. See the section Mouse Tracking. This is the X11
xterm mouse protocol.
Ps = 1 0 0 1 -> Use Hilite Mouse Tracking, xterm.
Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking, xterm. See
the section Button-event tracking.
Ps = 1 0 0 3 -> Use All Motion Mouse Tracking, xterm. See
the section Any-event tracking.
Ps = 1 0 0 4 -> Send FocusIn/FocusOut events, xterm.
Ps = 1 0 0 5 -> Enable UTF-8 Mouse Mode, xterm.
Ps = 1 0 0 6 -> Enable SGR Mouse Mode, xterm.
Ps = 1 0 0 7 -> Enable Alternate Scroll Mode, xterm. This
corresponds to the alternateScroll resource.
Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt).
This sets the scrollTtyOutput resource to "true".
Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). This
sets the scrollKey resource to "true".
Ps = 1 0 1 5 -> Enable urxvt Mouse Mode.
Ps = 1 0 1 6 -> Enable SGR Mouse PixelMode, xterm.
Ps = 1 0 3 4 -> Interpret "meta" key, xterm. This sets the
eighth bit of keyboard input (and enables the eightBitInput
resource).
Ps = 1 0 3 5 -> Enable special modifiers for Alt and
NumLock keys, xterm. This enables the numLock resource.
Ps = 1 0 3 6 -> Send ESC when Meta modifies a key, xterm.
This enables the metaSendsEscape resource.
Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete
key, xterm.
Ps = 1 0 3 9 -> Send ESC when Alt modifies a key, xterm.
This enables the altSendsEscape resource, xterm.
Ps = 1 0 4 0 -> Keep selection even if not highlighted,
xterm. This enables the keepSelection resource.
Ps = 1 0 4 1 -> Use the CLIPBOARD selection, xterm. This
enables the selectToClipboard resource.
Ps = 1 0 4 2 -> Enable Urgency window manager hint when
Control-G is received, xterm. This enables the bellIsUrgent
resource.
Ps = 1 0 4 3 -> Enable raising of the window when Control-G
is received, xterm. This enables the popOnBell resource.
Ps = 1 0 4 4 -> Reuse the most recent data copied to
CLIPBOARD, xterm. This enables the keepClipboard resource.
Ps = 1 0 4 6 -> Enable switching to/from Alternate Screen
Buffer, xterm. This works for terminfo-based systems,
updating the titeInhibit resource.
Ps = 1 0 4 7 -> Use Alternate Screen Buffer, xterm. This
may be disabled by the titeInhibit resource.
Ps = 1 0 4 8 -> Save cursor as in DECSC, xterm. This may
be disabled by the titeInhibit resource.
Ps = 1 0 4 9 -> Save cursor as in DECSC, xterm. After
saving the cursor, switch to the Alternate Screen Buffer,
clearing it first. This may be disabled by the titeInhibit
resource. This control combines the effects of the 1 0 4 7
and 1 0 4 8 modes. Use this with terminfo-based applications
rather than the 4 7 mode.
Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode,
xterm.
Ps = 1 0 5 1 -> Set Sun function-key mode, xterm.
Ps = 1 0 5 2 -> Set HP function-key mode, xterm.
Ps = 1 0 5 3 -> Set SCO function-key mode, xterm.
Ps = 1 0 6 0 -> Set legacy keyboard emulation, i.e, X11R6,
xterm.
Ps = 1 0 6 1 -> Set VT220 keyboard emulation, xterm.
Ps = 2 0 0 4 -> Set bracketed paste mode, xterm.
CSI Ps i Media Copy (MC).
Ps = 0 -> Print screen (default).
Ps = 4 -> Turn off printer controller mode.
Ps = 5 -> Turn on printer controller mode.
Ps = 1 0 -> HTML screen dump, xterm.
Ps = 1 1 -> SVG screen dump, xterm.
CSI ? Ps i
Media Copy (MC), DEC-specific.
Ps = 1 -> Print line containing cursor.
Ps = 4 -> Turn off autoprint mode.
Ps = 5 -> Turn on autoprint mode.
Ps = 1 0 -> Print composed display, ignores DECPEX.
Ps = 1 1 -> Print all pages.
CSI Pm l Reset Mode (RM).
Ps = 2 -> Keyboard Action Mode (KAM).
Ps = 4 -> Replace Mode (IRM).
Ps = 1 2 -> Send/receive (SRM).
Ps = 2 0 -> Normal Linefeed (LNM).
CSI ? Pm l
DEC Private Mode Reset (DECRST).
Ps = 1 -> Normal Cursor Keys (DECCKM), VT100.
Ps = 2 -> Designate VT52 mode (DECANM), VT100.
Ps = 3 -> 80 Column Mode (DECCOLM), VT100.
Ps = 4 -> Jump (Fast) Scroll (DECSCLM), VT100.
Ps = 5 -> Normal Video (DECSCNM), VT100.
Ps = 6 -> Normal Cursor Mode (DECOM), VT100.
Ps = 7 -> No Auto-Wrap Mode (DECAWM), VT100.
Ps = 8 -> No Auto-Repeat Keys (DECARM), VT100.
Ps = 9 -> Don't send Mouse X & Y on button press, xterm.
Ps = 1 0 -> Hide toolbar (rxvt).
Ps = 1 2 -> Stop blinking cursor (AT&T 610).
Ps = 1 3 -> Disable blinking cursor (reset only via
resource or menu).
Ps = 1 4 -> Disable XOR of blinking cursor control sequence
and menu.
Ps = 1 8 -> Don't Print Form Feed (DECPFF), VT220.
Ps = 1 9 -> Limit print to scrolling region (DECPEX),
VT220.
Ps = 2 5 -> Hide cursor (DECTCEM), VT220.
Ps = 3 0 -> Don't show scrollbar (rxvt).
Ps = 3 5 -> Disable font-shifting functions (rxvt).
Ps = 4 0 -> Disallow 80 -> 132 mode, xterm.
Ps = 4 1 -> No more(1) fix (see curses resource).
Ps = 4 2 -> Disable National Replacement Character sets
(DECNRCM), VT220.
Ps = 4 3 -> Disable Graphics Expanded Print Mode (DECGEPM).
Ps = 4 4 -> Turn off margin bell, xterm.
Ps = 4 4 -> Disable Graphics Print Color Mode (DECGPCM).
Ps = 4 5 -> No Reverse-wraparound mode, xterm.
Ps = 4 5 -> Disable Graphics Print ColorSpace (DECGPCS).
Ps = 4 6 -> Stop logging, xterm. This is normally disabled
by a compile-time option.
Ps = 4 7 -> Use Normal Screen Buffer, xterm.
Ps = 4 7 -> Disable Graphics Rotated Print Mode (DECGRPM).
Ps = 6 6 -> Numeric keypad mode (DECNKM), VT320.
Ps = 6 7 -> Backarrow key sends delete (DECBKM), VT340,
VT420. This sets the backarrowKey resource to "false".
Ps = 6 9 -> Disable left and right margin mode (DECLRMM),
VT420 and up.
Ps = 8 0 -> Enable Sixel Scrolling (DECSDM).
Ps = 9 5 -> Clear screen when DECCOLM is set/reset
(DECNCSM), VT510 and up.
Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and
release. See the section Mouse Tracking.
Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking, xterm.
Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking,
xterm. See the section Button-event tracking.
Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking, xterm.
See the section Any-event tracking.
Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events, xterm.
Ps = 1 0 0 5 -> Disable UTF-8 Mouse Mode, xterm.
Ps = 1 0 0 6 -> Disable SGR Mouse Mode, xterm.
Ps = 1 0 0 7 -> Disable Alternate Scroll Mode, xterm. This
corresponds to the alternateScroll resource.
Ps = 1 0 1 0 -> Don't scroll to bottom on tty output
(rxvt). This sets the scrollTtyOutput resource to "false".
Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt).
This sets the scrollKey resource to "false".
Ps = 1 0 1 5 -> Disable urxvt Mouse Mode.
Ps = 1 0 1 6 -> Disable SGR Mouse Pixel-Mode, xterm.
Ps = 1 0 3 4 -> Don't interpret "meta" key, xterm. This
disables the eightBitInput resource.
Ps = 1 0 3 5 -> Disable special modifiers for Alt and
NumLock keys, xterm. This disables the numLock resource.
Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key,
xterm. This disables the metaSendsEscape resource.
Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad
Delete key, xterm.
Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key,
xterm. This disables the altSendsEscape resource.
Ps = 1 0 4 0 -> Do not keep selection when not highlighted,
xterm. This disables the keepSelection resource.
Ps = 1 0 4 1 -> Use the PRIMARY selection, xterm. This
disables the selectToClipboard resource.
Ps = 1 0 4 2 -> Disable Urgency window manager hint when
Control-G is received, xterm. This disables the bellIsUrgent
resource.
Ps = 1 0 4 3 -> Disable raising of the window when Control-
G is received, xterm. This disables the popOnBell resource.
Ps = 1 0 4 6 -> Disable switching to/from Alternate Screen
Buffer, xterm. This works for terminfo-based systems,
updating the titeInhibit resource. If currently using the
Alternate Screen Buffer, xterm switches to the Normal Screen
Buffer.
Ps = 1 0 4 7 -> Use Normal Screen Buffer, xterm. Clear the
screen first if in the Alternate Screen Buffer. This may be
disabled by the titeInhibit resource.
Ps = 1 0 4 8 -> Restore cursor as in DECRC, xterm. This
may be disabled by the titeInhibit resource.
Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor
as in DECRC, xterm. This may be disabled by the titeInhibit
resource. This combines the effects of the 1 0 4 7 and 1 0 4
8 modes. Use this with terminfo-based applications rather
than the 4 7 mode.
Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode,
xterm.
Ps = 1 0 5 1 -> Reset Sun function-key mode, xterm.
Ps = 1 0 5 2 -> Reset HP function-key mode, xterm.
Ps = 1 0 5 3 -> Reset SCO function-key mode, xterm.
Ps = 1 0 6 0 -> Reset legacy keyboard emulation, i.e,
X11R6, xterm.
Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style,
xterm.
Ps = 2 0 0 4 -> Reset bracketed paste mode, xterm.
CSI Pm m Character Attributes (SGR).
Ps = 0 -> Normal (default), VT100.
Ps = 1 -> Bold, VT100.
Ps = 2 -> Faint, decreased intensity, ECMA-48 2nd.
Ps = 3 -> Italicized, ECMA-48 2nd.
Ps = 4 -> Underlined, VT100.
Ps = 5 -> Blink, VT100.
This appears as Bold in X11R6 xterm.
Ps = 7 -> Inverse, VT100.
Ps = 8 -> Invisible, i.e., hidden, ECMA-48 2nd, VT300.