1
Date: 12 Sep 89 17:44:43 GMT
2
From: crdgw1!montnaro@uunet.uu.net (Skip Montanaro)
3
Organization: GE Corporate Research & Development, Schenectady, NY
4
Subject: XTerm Escape Sequences (X11 Version)
5
To: xpert@expo.lcs.mit.edu
7
I rummaged around through the xterm code and came up with the following
8
stuff. No guarantees. I'm headed out of town for a couple days and thought
9
it better to get it out than let it get stale. Comments, bugs, and other
10
notes are welcome. Somebody else can convert it to troff. I prefer LaTeX.
11
:-) I will try and get to the Tek mode stuff when I return, although I doubt
12
it's changed much from X10 XTerm.
14
I gleaned the basic stuff out of the charproc.c code, by hacking VTparse()
15
so it spit out leaves of the parse tree. I was mildly surprised to see
16
things like "ESC # BEL" turn up.
18
For most folks, the most interesting stuff will probably be "ESC ] Ps ND
19
string NP" down near the bottom. That's what you use to change the icon and
20
window labels, and the log file name. Most other things appear the same as
21
the X10 documentation, although a few DEC-ish mode parameters (42, 43, 48, &
22
49) seem to have disappeared.
24
------------------------------------------------------------------------------
27
HT Horizontal Tab (Ctrl-I)
28
NL Line Feed or New Line (Ctrl-J)
29
VT Vertical Tab (Ctrl-K)
30
NP Form Feed or New Page (Ctrl-L)
31
CR Carriage Return (Ctrl-M)
32
SO Shift Out (Ctrl-N) -> Switch to Alternate Character Set
33
SI Shift In (Ctrl-O) -> Switch to Standard Character Set
34
ESC BEL (Same as non-escaped BEL)
35
ESC BS (Same as non-escaped BS)
36
ESC HT (Same as non-escaped HT)
37
ESC NL (Same as non-escaped NL)
38
ESC VT (Same as non-escaped VT)
39
ESC NP (Same as non-escaped NP)
40
ESC CR (Same as non-escaped CR)
41
ESC SO (Same as non-escaped SO)
42
ESC SI (Same as non-escaped SI)
43
ESC # BEL (Same as non-escaped BEL)
44
ESC # BS (Same as non-escaped BS)
45
ESC # HT (Same as non-escaped HT)
46
ESC # NL (Same as non-escaped NL)
47
ESC # VT (Same as non-escaped VT)
48
ESC # NP (Same as non-escaped NP)
49
ESC # CR (Same as non-escaped CR)
50
ESC # SO (Same as non-escaped SO)
51
ESC # SI (Same as non-escaped SI)
52
ESC # 8 DEC Screen Alignment Test (DECALN)
53
ESC ( BEL (Same as non-escaped BEL)
54
ESC ( BS (Same as non-escaped BS)
55
ESC ( HT (Same as non-escaped HT)
56
ESC ( NL (Same as non-escaped NL)
57
ESC ( VT (Same as non-escaped VT)
58
ESC ( NP (Same as non-escaped NP)
59
ESC ( CR (Same as non-escaped CR)
60
ESC ( SO (Same as non-escaped SO)
61
ESC ( SI (Same as non-escaped SI)
62
ESC ( C Select G0 Character Set (SCS)
63
C = 0 -> Special Character and Line Drawing Set
64
C = 1 -> Alternate Character ROM Standard Set
65
C = 2 -> Alternate Character ROM Special Set
66
C = A -> United Kingdom (UK)
67
C = B -> United States (USASCII)
68
ESC ) C Select G1 Character Set (SCS)
69
C takes same values as above
70
ESC * C Select G2 Character Set (SCS)
71
C takes same values as above
72
ESC + C Select G3 Character Set (SCS)
73
C takes same values as above
74
ESC 7 Save Cursor (DECSC)
75
ESC 8 Restore Cursor (DECRC)
76
ESC = Application Keypad (DECPAM)
77
ESC > Normal Keypad (DECNM)
81
ESC M Reverse Index (RI)
82
ESC N Single Shift Select of G2 Character Set (SS2)
83
ESC O Single Shift Select of G3 Character Set (SS3)
84
ESC [ BEL (Same as non-escaped BEL)
85
ESC [ BS (Same as non-escaped BS)
86
ESC [ HT (Same as non-escaped HT)
87
ESC [ NL (Same as non-escaped NL)
88
ESC [ VT (Same as non-escaped VT)
89
ESC [ NP (Same as non-escaped NP)
90
ESC [ CR (Same as non-escaped CR)
91
ESC [ SO (Same as non-escaped SO)
92
ESC [ SI (Same as non-escaped SI)
93
ESC [ ? BEL (Same as non-escaped BEL)
94
ESC [ ? BS (Same as non-escaped BS)
95
ESC [ ? HT (Same as non-escaped HT)
96
ESC [ ? NL (Same as non-escaped NL)
97
ESC [ ? VT (Same as non-escaped VT)
98
ESC [ ? NP (Same as non-escaped NP)
99
ESC [ ? CR (Same as non-escaped CR)
100
ESC [ ? SO (Same as non-escaped SO)
101
ESC [ ? SI (Same as non-escaped SI)
102
ESC [ ? Ps h DEC Private Mode Set (DECSET)
103
Ps = 1 -> Application Cursor Keys (DECCKM)
104
Ps = 2 -> Set VT52 Mode
105
Ps = 3 -> 132 Column Mode (DECCOLM)
106
Ps = 4 -> Smooth (Slow) Scroll (DECSCLM)
107
Ps = 5 -> Reverse Video (DECSCNM)
108
Ps = 6 -> Origin Mode (DECOM)
109
Ps = 7 -> Wraparound Mode (DECAWM)
110
Ps = 8 -> Auto-Repeat Keys (DECARM)
111
Ps = 9 -> Send MIT Mouse Row & Column on Button
113
Ps = 38 -> Enter Tektronix Mode (DECTEK)
114
Ps = 40 -> Allow 80 <-> 132 Mode
115
Ps = 41 -> curses(5) fix
116
Ps = 44 -> Turn on Margin Bell
117
Ps = 45 -> Reverse-wraparound Mode
118
Ps = 46 -> Start Logging
119
Ps = 47 -> Use Alternate Screen Buffer
120
Ps = 1000 -> xtem bogus sequence (???)
121
Ps = 1001 -> xtem sequence w/hilite tracking (???)
122
ESC [ ? Ps l DEC Private Mode Reset (DECRST)
123
Ps = 1 -> Normal Cursor Keys (DECCKM)
124
Ps = 3 -> 80 Column Mode (DECCOLM)
125
Ps = 4 -> Jump (Fast) Scroll (DECSCLM)
126
Ps = 5 -> Normal Video (DECSCNM)
127
Ps = 6 -> Normal Cursor Mode (DECOM)
128
Ps = 7 -> No Wraparound Mode (DECAWM)
129
Ps = 8 -> No Auto-Repeat Keys (DECARM)
130
Ps = 9 -> Don't Send MIT Mouse Row & Column on
132
Ps = 40 -> Don't Allow 80 <-> 132 Mode
133
Ps = 41 -> No curses(5) fix
134
Ps = 44 -> Turn Off Margin Bell
135
Ps = 45 -> No Reverse-wraparound Mode
136
Ps = 46 -> Stop Logging
137
Ps = 47 -> Use Normal Screen Buffer
138
Ps = 1000 -> xtem bogus sequence (???)
139
Ps = 1001 -> xtem sequence w/hilite tracking (???)
140
ESC [ ? Ps r Restore DEC Private Mode
141
Ps = 1 -> Normal/Application Cursor Keys (DECCKM)
142
Ps = 3 -> 80/132 Column Mode (DECCOLM)
143
Ps = 4 -> Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
144
Ps = 5 -> Normal/Reverse Video (DECSCNM)
145
Ps = 6 -> Normal/Origin Cursor Mode (DECOM)
146
Ps = 7 -> No Wraparound/Wraparound Mode (DECAWM)
147
Ps = 8 -> Auto-repeat/No Auto-repeat Keys (DECARM)
148
Ps = 9 -> Don't Send/Send MIT Mouse Row & Column on
150
Ps = 40 -> Disallow/Allow 80 <-> 132 Mode
151
Ps = 41 -> Off/On curses(5) fix
152
Ps = 44 -> Turn Off/On Margin Bell
153
Ps = 45 -> No Reverse-wraparound/Reverse-wraparound
155
Ps = 46 -> Stop/Start Logging
156
Ps = 47 -> Use Normal/Alternate Screen Buffer
157
Ps = 1000 -> mouse bogus sequence (???)
158
Ps = 1001 -> mouse bogus sequence (???)
159
ESC [ ? Ps s Save DEC Private Mode
160
Same P's as Restore DEC Private Mode
161
ESC [ Ps @ Insert Ps (Blank) Character(s) (default = 1) (ICH)
162
ESC [ Ps A Cursor Up Ps Times (default = 1) (CUU)
163
ESC [ Ps B Cursor Down Ps Times (default = 1) (CUD)
164
ESC [ Ps C Cursor Forward Ps Times (default = 1) (CUF)
165
ESC [ Ps D Cursor Backward Ps Times (default = 1) (CUB)
166
ESC [ Ps ; Ps H Cursor Position [row;column] (default = [1,1]) (CUP)
167
ESC [ Ps J Erase in Display
168
Ps = 0 -> Clear Below (default)
169
Ps = 1 -> Clear Above
171
ESC [ Ps K Erase in Line
172
Ps = 0 -> Clear to Right (default)
173
Ps = 1 -> Clear to Left
175
ESC [ Ps L Insert Ps lines (default = 1) (IL)
176
ESC [ Ps M Delete Ps lines (default = 1) (DL)
177
ESC [ Ps P Delete Ps Characters (default = 1) (DCH)
178
ESC [ T Track Mouse (???)
179
ESC [ Ps c Device Attributes (DA1)
180
ESC [ Ps ; Ps f Cursor Position [row;column] (default = [1,1]) (HVP)
182
Ps = 0 -> Clear Current Column (default)
184
ESC [ Ps h Mode Set (SET)
185
Ps = 4 -> Insert Mode (IRM)
186
Ps = 20 -> Automatic Linefeed (LNM)
187
ESC [ Ps l Mode Reset (RST)
188
Ps = 4 -> Insert Mode (IRM)
189
Ps = 20 -> Automatic Linefeed (LNM)
190
ESC [ Pm m Character Attributes (SGR)
191
Ps = 0 -> Normal (default)
192
Ps = 1 -> Blink (appears as Bold)
196
ESC [ Ps n Device Status Report (DSR)
197
Ps = 5 -> Status Report ESC [ 0 n -> OK
198
Ps = 6 -> Report Cursor Position (CPR) [row;column]
200
ESC [ Ps ; Ps r Set Scrolling Region [top;bottom] (default = full size
202
ESC [ Ps x Request Terminal Parameters (DECREQTPARM)
203
ESC ] Ps ND string NP OSC Mode
204
ND can be any non-digit Character (it's discarded)
205
NP can be any non-printing Character (it's discarded)
206
string can be any ASCII printable string
208
Ps = 0 -> use string as a new icon name and title
209
Ps = 1 -> use string is a new icon name only
210
Ps = 2 -> use string is a new title only
211
Ps = 46 -> use string as a new log file name
214
ESC n Switch to Alternate Character Set LS2
215
ESC o Switch to Alternate Character Set LS3
216
ESC | Switch to Alternate Graphics(?) Set LS3R
217
ESC } Switch to Alternate Graphics(?) Set LS2R
218
ESC ~ Switch to Alternate Graphics(?) Set LS1R
220
Skip Montanaro (montanaro@crdgw1.ge.com)