ctlseqs.txt revision a1f3da82
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-2010)
24
25
26
27Definitions
28
29c    The literal character c.
30
31C    A single (required) character.
32
33Ps   A single (usually optional) numeric parameter, composed of one of
34     more digits.
35
36Pm   A multiple numeric parameter composed of any number of single
37     numeric parameters, separated by ;  character(s).  Individual val-
38     ues for the parameters are listed with Ps .
39
40Pt   A text parameter composed of printable characters.
41
42C1 (8-Bit) Control Characters
43
44The xterm program recognizes both 8-bit and 7-bit control characters.
45It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
46The following pairs of 7-bit and 8-bit control characters are equiva-
47lent:
48
49ESC D
50     Index (IND  is 0x84).
51ESC E
52     Next Line (NEL  is 0x85).
53ESC H
54     Tab Set (HTS  is 0x88).
55ESC M
56     Reverse Index (RI  is 0x8d).
57ESC N
58     Single Shift Select of G2 Character Set (SS2  is 0x8e).  This
59     affects next character only.
60ESC O
61     Single Shift Select of G3 Character Set (SS3  is 0x8f).  This
62     affects next character only.
63ESC P
64     Device Control String (DCS  is 0x90).
65ESC V
66     Start of Guarded Area (SPA  is 0x96).
67ESC W
68     End of Guarded Area (EPA  is 0x97).
69ESC X
70     Start of String (SOS  is 0x98).
71ESC Z
72     Return Terminal ID (DECID is 0x9a).  Obsolete form of CSI c  (DA).
73ESC [
74     Control Sequence Introducer (CSI  is 0x9b).
75ESC \
76     String Terminator (ST  is 0x9c).
77ESC ]
78     Operating System Command (OSC  is 0x9d).
79ESC ^
80     Privacy Message (PM  is 0x9e).
81ESC _
82     Application Program Command (APC  is 0x9f).
83
84These control characters are used in the vtXXX emulation.
85
86VT100 Mode
87Most of these control sequences are standard VT102 control sequences,
88but there is support for later DEC VT terminals (i.e., VT220, VT320,
89VT420), as well as ISO 6429 and aixterm color controls.  The only VT102
90feature not supported is auto-repeat, since the only way X provides for
91this will affect all windows.  There are additional control sequences to
92provide xterm-dependent functions, such as the scrollbar or window size.
93Where the function is specified by DEC or ISO 6429, the code assigned to
94it is given in parentheses.  The escape codes to designate and invoke
95character sets are specified by ISO 2022; see that document for a dis-
96cussion of character sets.
97
98Single-character functions
99BEL       Bell (Ctrl-G).
100BS        Backspace (Ctrl-H).
101CR        Carriage Return (Ctrl-M).
102ENQ       Return Terminal Status (Ctrl-E).  Default response is an empty
103          string, but may be overridden by a resource answerbackString.
104FF        Form Feed or New Page (NP).  Ctrl-L is treated the same as LF.
105LF        Line Feed or New Line (NL).  (LF is Ctrl-J).
106SI        Shift In (Ctrl-O) -> Switch to Standard Character Set.  This
107          invokes the G0 character set (the default).
108SO        Shift Out (Ctrl-N) -> Switch to Alternate Character Set.  This
109          invokes the G1 character set.
110SP        Space.
111TAB       Horizontal Tab (HT) (Ctrl-I).
112VT        Vertical Tab (Ctrl-K).  This is treated the same as LF.
113
114Controls beginning with ESC
115This excludes controls where ESC is part of a 7-bit equivalent to 8-bit
116C1 controls, ordered by the final character(s).
117ESC SP F  7-bit controls (S7C1T).
118ESC SP G  8-bit controls (S8C1T).
119ESC SP L  Set ANSI conformance level 1 (dpANS X3.134.1).
120ESC SP M  Set ANSI conformance level 2 (dpANS X3.134.1).
121ESC SP N  Set ANSI conformance level 3 (dpANS X3.134.1).
122ESC # 3   DEC double-height line, top half (DECDHL).
123ESC # 4   DEC double-height line, bottom half (DECDHL).
124ESC # 5   DEC single-width line (DECSWL).
125ESC # 6   DEC double-width line (DECDWL).
126ESC # 8   DEC Screen Alignment Test (DECALN).
127ESC % @   Select default character set.  That is ISO 8859-1 (ISO 2022).
128ESC % G   Select UTF-8 character set (ISO 2022).
129ESC ( C   Designate G0 Character Set (ISO 2022, VT100).
130          Final character C for designating 94-character sets.  In this
131          list, 0 , A  and B  apply to VT100 and up, the remainder to
132          VT220 and up:
133            C = 0  -> DEC Special Character and Line Drawing Set.
134            C = A  -> United Kingdom (UK).
135            C = B  -> United States (USASCII).
136            C = 4  -> Dutch.
137            C = C  or 5  -> Finnish.
138            C = R  -> French.
139            C = Q  -> French Canadian.
140            C = K  -> German.
141            C = Y  -> Italian.
142            C = E  or 6  -> Norwegian/Danish.
143            C = Z  -> Spanish.
144            C = H  or 7  -> Swedish.
145            C = =  -> Swiss.
146ESC ) C   Designate G1 Character Set (ISO 2022, VT100).
147          The same character sets apply as for ESC ( C.
148ESC * C   Designate G2 Character Set (ISO 2022, VT220).
149          The same character sets apply as for ESC ( C.
150ESC + C   Designate G3 Character Set (ISO 2022, VT220).
151          The same character sets apply as for ESC ( C.
152ESC - C   Designate G1 Character Set (VT300).
153          The same character sets apply as for ESC ( C.
154ESC . C   Designate G2 Character Set (VT300).
155          The same character sets apply as for ESC ( C.
156ESC / C   Designate G3 Character Set (VT300).
157          These work for 96-character sets only.
158            C = A  -> ISO Latin-1 Supplemental.
159ESC 7     Save Cursor (DECSC).
160ESC 8     Restore Cursor (DECRC).
161ESC =     Application Keypad (DECPAM).
162ESC >     Normal Keypad (DECPNM).
163ESC F     Cursor to lower left corner of screen.  This is enabled by the
164          hpLowerleftBugCompat resource.
165ESC c     Full Reset (RIS).
166ESC l     Memory Lock (per HP terminals).  Locks memory above the cur-
167          sor.
168ESC m     Memory Unlock (per HP terminals).
169ESC n     Invoke the G2 Character Set as GL (LS2).
170ESC o     Invoke the G3 Character Set as GL (LS3).
171ESC |     Invoke the G3 Character Set as GR (LS3R).
172ESC }     Invoke the G2 Character Set as GR (LS2R).
173ESC ~     Invoke the G1 Character Set as GR (LS1R).
174
175Application Program-Control functions
176APC Pt ST None.  xterm implements no APC  functions; Pt is ignored.  Pt
177          need not be printable characters.
178
179Device-Control functions
180DCS Ps; Ps| Pt ST
181          User-Defined Keys (DECUDK).  The first parameter:
182            Ps = 0  -> Clear all UDK definitions before starting
183          (default).
184            Ps = 1  -> Erase Below (default).
185          The second parameter:
186            Ps = 0  <- Lock the keys (default).
187            Ps = 1  <- Do not lock.
188          The third parameter is a ';'-separated list of strings denot-
189          ing the key-code separated by a '/' from the hex-encoded key
190          value.  The key codes correspond to the DEC function-key codes
191          (e.g., F6=17).
192DCS $ q Pt ST
193          Request Status String (DECRQSS).  The string following the "q"
194          is one of the following:
195            " q     -> DECSCA
196            " p     -> DECSCL
197            r       -> DECSTBM
198            m       -> SGR
199          xterm responds with DCS 1 $ r Pt ST for valid requests,
200          replacing the Pt with the corresponding CSI string, or DCS 0 $
201          r Pt ST for invalid requests.
202DCS + p Pt ST
203          Set Termcap/Terminfo Data (xterm, experimental).  The string
204          following the "p" is a name to use for retrieving data from
205          the terminal database.  The data will be used for the "tcap"
206          keyboard configuration's function- and special-keys, as well
207          as by the Request Termcap/Terminfo String control.
208DCS + q Pt ST
209          Request Termcap/Terminfo String (xterm, experimental).  The
210          string following the "q" is a list of names encoded in hexa-
211          decimal (2 digits per character) separated by ; which corre-
212          spond to termcap or terminfo key names.
213          Two special features are also recognized, which are not key
214          names: Co for termcap colors (or colors for terminfo colors),
215          and TN for termcap name (or name for terminfo name).
216          xterm responds with DCS 1 + r Pt ST for valid requests, adding
217          to Pt an = , and the value of the corresponding string that
218          xterm would send, or DCS 0 + r Pt ST for invalid requests.
219          The strings are encoded in hexadecimal (2 digits per charac-
220          ter).
221
222Functions using CSI , ordered by the final character(s)
223CSI Ps @  Insert Ps (Blank) Character(s) (default = 1) (ICH).
224CSI Ps A  Cursor Up Ps Times (default = 1) (CUU).
225CSI Ps B  Cursor Down Ps Times (default = 1) (CUD).
226CSI Ps C  Cursor Forward Ps Times (default = 1) (CUF).
227CSI Ps D  Cursor Backward Ps Times (default = 1) (CUB).
228CSI Ps E  Cursor Next Line Ps Times (default = 1) (CNL).
229CSI Ps F  Cursor Preceding Line Ps Times (default = 1) (CPL).
230CSI Ps G  Cursor Character Absolute  [column] (default = [row,1]) (CHA).
231CSI Ps ; Ps H
232          Cursor Position [row;column] (default = [1,1]) (CUP).
233CSI Ps I  Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).
234CSI Ps J  Erase in Display (ED).
235            Ps = 0  -> Erase Below (default).
236            Ps = 1  -> Erase Above.
237            Ps = 2  -> Erase All.
238            Ps = 3  -> Erase Saved Lines (xterm).
239CSI ? Ps J
240          Erase in Display (DECSED).
241            Ps = 0  -> Selective Erase Below (default).
242            Ps = 1  -> Selective Erase Above.
243            Ps = 2  -> Selective Erase All.
244CSI Ps K  Erase in Line (EL).
245            Ps = 0  -> Erase to Right (default).
246            Ps = 1  -> Erase to Left.
247            Ps = 2  -> Erase All.
248CSI ? Ps K
249          Erase in Line (DECSEL).
250            Ps = 0  -> Selective Erase to Right (default).
251            Ps = 1  -> Selective Erase to Left.
252            Ps = 2  -> Selective Erase All.
253CSI Ps L  Insert Ps Line(s) (default = 1) (IL).
254CSI Ps M  Delete Ps Line(s) (default = 1) (DL).
255CSI Ps P  Delete Ps Character(s) (default = 1) (DCH).
256CSI Ps S  Scroll up Ps lines (default = 1) (SU).
257CSI Ps T  Scroll down Ps lines (default = 1) (SD).
258CSI Ps ; Ps ; Ps ; Ps ; Ps T
259          Initiate highlight mouse tracking.  Parameters are
260          [func;startx;starty;firstrow;lastrow].  See the section Mouse
261          Tracking.
262CSI > Ps; Ps T
263          Reset one or more features of the title modes to the default
264          value.  Normally, "reset" disables the feature.  It is possi-
265          ble to disable the ability to reset features by compiling a
266          different default for the title modes into xterm.
267            Ps = 0  -> Do not set window/icon labels using hexadecimal.
268            Ps = 1  -> Do not query window/icon labels using hexadeci-
269          mal.
270            Ps = 2  -> Do not set window/icon labels using UTF-8.
271            Ps = 3  -> Do not query window/icon labels using UTF-8.
272          (See discussion of "Title Modes").
273CSI Ps X  Erase Ps Character(s) (default = 1) (ECH).
274CSI Ps Z  Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).
275CSI Pm `  Character Position Absolute  [column] (default = [row,1])
276          (HPA).
277CSI Ps b  Repeat the preceding graphic character Ps times (REP).
278CSI Ps c  Send Device Attributes (Primary DA).
279            Ps = 0  or omitted -> request attributes from terminal.  The
280          response depends on the decTerminalID resource setting.
281            -> CSI ? 1 ; 2 c  (``VT100 with Advanced Video Option'')
282            -> CSI ? 1 ; 0 c  (``VT101 with No Options'')
283            -> CSI ? 6 c  (``VT102'')
284            -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c  (``VT220'')
285          The VT100-style response parameters do not mean anything by
286          themselves.  VT220 parameters do, telling the host what fea-
287          tures the terminal supports:
288            Ps = 1  -> 132-columns.
289            Ps = 2  -> Printer.
290            Ps = 6  -> Selective erase.
291            Ps = 8  -> User-defined keys.
292            Ps = 9  -> National replacement character sets.
293            Ps = 1 5  -> Technical characters.
294            Ps = 2 2  -> ANSI color, e.g., VT525.
295            Ps = 2 9  -> ANSI text locator (i.e., DEC Locator mode).
296CSI > Ps c
297          Send Device Attributes (Secondary DA).
298            Ps = 0  or omitted -> request the terminal's identification
299          code.  The response depends on the decTerminalID resource set-
300          ting.  It should apply only to VT220 and up, but xterm extends
301          this to VT100.
302            -> CSI  > Pp ; Pv ; Pc c
303          where Pp denotes the terminal type
304            Pp = 0  -> ``VT100''.
305            Pp = 1  -> ``VT220''.
306          and Pv is the firmware version (for xterm, this was originally
307          the XFree86 patch number, starting with 95).  In a DEC termi-
308          nal, Pc indicates the ROM cartridge registration number and is
309          always zero.
310CSI Pm d  Line Position Absolute  [row] (default = [1,column]) (VPA).
311CSI Ps ; Ps f
312          Horizontal and Vertical Position [row;column] (default =
313          [1,1]) (HVP).
314CSI Ps g  Tab Clear (TBC).
315            Ps = 0  -> Clear Current Column (default).
316            Ps = 3  -> Clear All.
317CSI Pm h  Set Mode (SM).
318            Ps = 2  -> Keyboard Action Mode (AM).
319            Ps = 4  -> Insert Mode (IRM).
320            Ps = 1 2  -> Send/receive (SRM).
321            Ps = 2 0  -> Automatic Newline (LNM).
322CSI ? Pm h
323          DEC Private Mode Set (DECSET).
324            Ps = 1  -> Application Cursor Keys (DECCKM).
325            Ps = 2  -> Designate USASCII for character sets G0-G3
326          (DECANM), and set VT100 mode.
327            Ps = 3  -> 132 Column Mode (DECCOLM).
328            Ps = 4  -> Smooth (Slow) Scroll (DECSCLM).
329            Ps = 5  -> Reverse Video (DECSCNM).
330            Ps = 6  -> Origin Mode (DECOM).
331            Ps = 7  -> Wraparound Mode (DECAWM).
332            Ps = 8  -> Auto-repeat Keys (DECARM).
333            Ps = 9  -> Send Mouse X & Y on button press.  See the sec-
334          tion Mouse Tracking.
335            Ps = 1 0  -> Show toolbar (rxvt).
336            Ps = 1 2  -> Start Blinking Cursor (att610).
337            Ps = 1 8  -> Print form feed (DECPFF).
338            Ps = 1 9  -> Set print extent to full screen (DECPEX).
339            Ps = 2 5  -> Show Cursor (DECTCEM).
340            Ps = 3 0  -> Show scrollbar (rxvt).
341            Ps = 3 5  -> Enable font-shifting functions (rxvt).
342            Ps = 3 8  -> Enter Tektronix Mode (DECTEK).
343            Ps = 4 0  -> Allow 80 -> 132 Mode.
344            Ps = 4 1  -> more(1) fix (see curses resource).
345            Ps = 4 2  -> Enable Nation Replacement Character sets (DECN-
346          RCM).
347            Ps = 4 4  -> Turn On Margin Bell.
348            Ps = 4 5  -> Reverse-wraparound Mode.
349            Ps = 4 6  -> Start Logging.  This is normally disabled by a
350          compile-time option.
351            Ps = 4 7  -> Use Alternate Screen Buffer.  (This may be dis-
352          abled by the titeInhibit resource).
353            Ps = 6 6  -> Application keypad (DECNKM).
354            Ps = 6 7  -> Backarrow key sends backspace (DECBKM).
355            Ps = 1 0 0 0  -> Send Mouse X & Y on button press and
356          release.  See the section Mouse Tracking.
357            Ps = 1 0 0 1  -> Use Hilite Mouse Tracking.
358            Ps = 1 0 0 2  -> Use Cell Motion Mouse Tracking.
359            Ps = 1 0 0 3  -> Use All Motion Mouse Tracking.
360            Ps = 1 0 0 4  -> Send FocusIn/FocusOut events.
361            Ps = 1 0 0 5  -> Enable Extended Mouse Mode.
362            Ps = 1 0 1 0  -> Scroll to bottom on tty output (rxvt).
363            Ps = 1 0 1 1  -> Scroll to bottom on key press (rxvt).
364            Ps = 1 0 3 4  -> Interpret "meta" key, sets eighth bit.
365          (enables the eightBitInput resource).
366            Ps = 1 0 3 5  -> Enable special modifiers for Alt and Num-
367          Lock keys.  (This enables the numLock resource).
368            Ps = 1 0 3 6  -> Send ESC when Meta modifies a key.  (This
369          enables the metaSendsEscape resource).
370            Ps = 1 0 3 7  -> Send DEL from the editing-keypad Delete
371          key.
372            Ps = 1 0 3 9  -> Send ESC when Alt modifies a key.  (This
373          enables the altSendsEscape resource).
374            Ps = 1 0 4 0  -> Keep selection even if not highlighted.
375          (This enables the keepSelection resource).
376            Ps = 1 0 4 1  -> Use the CLIPBOARD selection.  (This enables
377          the selectToClipboard resource).
378            Ps = 1 0 4 2  -> Enable Urgency window manager hint when
379          Control-G is received.  (This enables the bellIsUrgent
380          resource).
381            Ps = 1 0 4 3  -> Enable raising of the window when Control-G
382          is received.  (enables the popOnBell resource).
383            Ps = 1 0 4 7  -> Use Alternate Screen Buffer.  (This may be
384          disabled by the titeInhibit resource).
385            Ps = 1 0 4 8  -> Save cursor as in DECSC.  (This may be dis-
386          abled by the titeInhibit resource).
387            Ps = 1 0 4 9  -> Save cursor as in DECSC and use Alternate
388          Screen Buffer, clearing it first.  (This may be disabled by
389          the titeInhibit resource).  This combines the effects of the 1
390          0 4 7  and 1 0 4 8  modes.  Use this with terminfo-based
391          applications rather than the 4 7  mode.
392            Ps = 1 0 5 0  -> Set terminfo/termcap function-key mode.
393            Ps = 1 0 5 1  -> Set Sun function-key mode.
394            Ps = 1 0 5 2  -> Set HP function-key mode.
395            Ps = 1 0 5 3  -> Set SCO function-key mode.
396            Ps = 1 0 6 0  -> Set legacy keyboard emulation (X11R6).
397            Ps = 1 0 6 1  -> Set VT220 keyboard emulation.
398            Ps = 2 0 0 4  -> Set bracketed paste mode.
399CSI Pm i  Media Copy (MC).
400            Ps = 0  -> Print screen (default).
401            Ps = 4  -> Turn off printer controller mode.
402            Ps = 5  -> Turn on printer controller mode.
403CSI ? Pm i
404          Media Copy (MC, DEC-specific).
405            Ps = 1  -> Print line containing cursor.
406            Ps = 4  -> Turn off autoprint mode.
407            Ps = 5  -> Turn on autoprint mode.
408            Ps = 1  0  -> Print composed display, ignores DECPEX.
409            Ps = 1  1  -> Print all pages.
410CSI Pm l  Reset Mode (RM).
411            Ps = 2  -> Keyboard Action Mode (AM).
412            Ps = 4  -> Replace Mode (IRM).
413            Ps = 1 2  -> Send/receive (SRM).
414            Ps = 2 0  -> Normal Linefeed (LNM).
415CSI ? Pm l
416          DEC Private Mode Reset (DECRST).
417            Ps = 1  -> Normal Cursor Keys (DECCKM).
418            Ps = 2  -> Designate VT52 mode (DECANM).
419            Ps = 3  -> 80 Column Mode (DECCOLM).
420            Ps = 4  -> Jump (Fast) Scroll (DECSCLM).
421            Ps = 5  -> Normal Video (DECSCNM).
422            Ps = 6  -> Normal Cursor Mode (DECOM).
423            Ps = 7  -> No Wraparound Mode (DECAWM).
424            Ps = 8  -> No Auto-repeat Keys (DECARM).
425            Ps = 9  -> Don't send Mouse X & Y on button press.
426            Ps = 1 0  -> Hide toolbar (rxvt).
427            Ps = 1 2  -> Stop Blinking Cursor (att610).
428            Ps = 1 8  -> Don't print form feed (DECPFF).
429            Ps = 1 9  -> Limit print to scrolling region (DECPEX).
430            Ps = 2 5  -> Hide Cursor (DECTCEM).
431            Ps = 3 0  -> Don't show scrollbar (rxvt).
432            Ps = 3 5  -> Disable font-shifting functions (rxvt).
433            Ps = 4 0  -> Disallow 80 -> 132 Mode.
434            Ps = 4 1  -> No more(1) fix (see curses resource).
435            Ps = 4 2  -> Disable Nation Replacement Character sets (DEC-
436          NRCM).
437            Ps = 4 4  -> Turn Off Margin Bell.
438            Ps = 4 5  -> No Reverse-wraparound Mode.
439            Ps = 4 6  -> Stop Logging.  (This is normally disabled by a
440          compile-time option).
441            Ps = 4 7  -> Use Normal Screen Buffer.
442            Ps = 6 6  -> Numeric keypad (DECNKM).
443            Ps = 6 7  -> Backarrow key sends delete (DECBKM).
444            Ps = 1 0 0 0  -> Don't send Mouse X & Y on button press and
445          release.  See the section Mouse Tracking.
446            Ps = 1 0 0 1  -> Don't use Hilite Mouse Tracking.
447            Ps = 1 0 0 2  -> Don't use Cell Motion Mouse Tracking.
448            Ps = 1 0 0 3  -> Don't use All Motion Mouse Tracking.
449            Ps = 1 0 0 4  -> Don't send FocusIn/FocusOut events.
450            Ps = 1 0 0 5  -> Disable Extended Mouse Mode.
451            Ps = 1 0 1 0  -> Don't scroll to bottom on tty output
452          (rxvt).
453            Ps = 1 0 1 1  -> Don't scroll to bottom on key press (rxvt).
454            Ps = 1 0 3 4  -> Don't interpret "meta" key.  (This disables
455          the eightBitInput resource).
456            Ps = 1 0 3 5  -> Disable special modifiers for Alt and Num-
457          Lock keys.  (This disables the numLock resource).
458            Ps = 1 0 3 6  -> Don't send ESC when Meta modifies a key.
459          (This disables the metaSendsEscape resource).
460            Ps = 1 0 3 7  -> Send VT220 Remove from the editing-keypad
461          Delete key.
462            Ps = 1 0 3 9  -> Don't send ESC when Alt modifies a key.
463          (This disables the altSendsEscape resource).
464            Ps = 1 0 4 0  -> Do not keep selection when not highlighted.
465          (This disables the keepSelection resource).
466            Ps = 1 0 4 1  -> Use the PRIMARY selection.  (This disables
467          the selectToClipboard resource).
468            Ps = 1 0 4 2  -> Disable Urgency window manager hint when
469          Control-G is received.  (This disables the bellIsUrgent
470          resource).
471            Ps = 1 0 4 3  -> Disable raising of the window when Control-
472          G is received.  (This disables the popOnBell resource).
473            Ps = 1 0 4 7  -> Use Normal Screen Buffer, clearing screen
474          first if in the Alternate Screen.  (This may be disabled by
475          the titeInhibit resource).
476            Ps = 1 0 4 8  -> Restore cursor as in DECRC.  (This may be
477          disabled by the titeInhibit resource).
478            Ps = 1 0 4 9  -> Use Normal Screen Buffer and restore cursor
479          as in DECRC.  (This may be disabled by the titeInhibit
480          resource).  This combines the effects of the 1 0 4 7  and 1 0
481          4 8  modes.  Use this with terminfo-based applications rather
482          than the 4 7  mode.
483            Ps = 1 0 5 0  -> Reset terminfo/termcap function-key mode.
484            Ps = 1 0 5 1  -> Reset Sun function-key mode.
485            Ps = 1 0 5 2  -> Reset HP function-key mode.
486            Ps = 1 0 5 3  -> Reset SCO function-key mode.
487            Ps = 1 0 6 0  -> Reset legacy keyboard emulation (X11R6).
488            Ps = 1 0 6 1  -> Reset keyboard emulation to Sun/PC style.
489            Ps = 2 0 0 4  -> Reset bracketed paste mode.
490CSI Pm m  Character Attributes (SGR).
491            Ps = 0  -> Normal (default).
492            Ps = 1  -> Bold.
493            Ps = 4  -> Underlined.
494            Ps = 5  -> Blink (appears as Bold).
495            Ps = 7  -> Inverse.
496            Ps = 8  -> Invisible, i.e., hidden (VT300).
497            Ps = 2 2  -> Normal (neither bold nor faint).
498            Ps = 2 4  -> Not underlined.
499            Ps = 2 5  -> Steady (not blinking).
500            Ps = 2 7  -> Positive (not inverse).
501            Ps = 2 8  -> Visible, i.e., not hidden (VT300).
502            Ps = 3 0  -> Set foreground color to Black.
503            Ps = 3 1  -> Set foreground color to Red.
504            Ps = 3 2  -> Set foreground color to Green.
505            Ps = 3 3  -> Set foreground color to Yellow.
506            Ps = 3 4  -> Set foreground color to Blue.
507            Ps = 3 5  -> Set foreground color to Magenta.
508            Ps = 3 6  -> Set foreground color to Cyan.
509            Ps = 3 7  -> Set foreground color to White.
510            Ps = 3 9  -> Set foreground color to default (original).
511            Ps = 4 0  -> Set background color to Black.
512            Ps = 4 1  -> Set background color to Red.
513            Ps = 4 2  -> Set background color to Green.
514            Ps = 4 3  -> Set background color to Yellow.
515            Ps = 4 4  -> Set background color to Blue.
516            Ps = 4 5  -> Set background color to Magenta.
517            Ps = 4 6  -> Set background color to Cyan.
518            Ps = 4 7  -> Set background color to White.
519            Ps = 4 9  -> Set background color to default (original).
520
521          If 16-color support is compiled, the following apply.  Assume
522          that xterm's resources are set so that the ISO color codes are
523          the first 8 of a set of 16.  Then the aixterm colors are the
524          bright versions of the ISO colors:
525            Ps = 9 0  -> Set foreground color to Black.
526            Ps = 9 1  -> Set foreground color to Red.
527            Ps = 9 2  -> Set foreground color to Green.
528            Ps = 9 3  -> Set foreground color to Yellow.
529            Ps = 9 4  -> Set foreground color to Blue.
530            Ps = 9 5  -> Set foreground color to Magenta.
531            Ps = 9 6  -> Set foreground color to Cyan.
532            Ps = 9 7  -> Set foreground color to White.
533            Ps = 1 0 0  -> Set background color to Black.
534            Ps = 1 0 1  -> Set background color to Red.
535            Ps = 1 0 2  -> Set background color to Green.
536            Ps = 1 0 3  -> Set background color to Yellow.
537            Ps = 1 0 4  -> Set background color to Blue.
538            Ps = 1 0 5  -> Set background color to Magenta.
539            Ps = 1 0 6  -> Set background color to Cyan.
540            Ps = 1 0 7  -> Set background color to White.
541
542          If xterm is compiled with the 16-color support disabled, it
543          supports the following, from rxvt:
544            Ps = 1 0 0  -> Set foreground and background color to
545          default.
546
547          If 88- or 256-color support is compiled, the following apply.
548            Ps = 3 8  ; 5  ; Ps -> Set foreground color to the second
549          Ps.
550            Ps = 4 8  ; 5  ; Ps -> Set background color to the second
551          Ps.
552
553CSI > Ps; Ps m
554          Set or reset resource-values used by xterm to decide whether
555          to construct escape sequences holding information about the
556          modifiers pressed with a given key.  The first parameter iden-
557          tifies the resource to set/reset.  The second parameter is the
558          value to assign to the resource.  If the second parameter is
559          omitted, the resource is reset to its initial value.
560            Ps = 1  -> modifyCursorKeys.
561            Ps = 2  -> modifyFunctionKeys.
562            Ps = 4  -> modifyOtherKeys.
563          If no parameters are given, all resources are reset to their
564          initial values.
565CSI Ps n  Device Status Report (DSR).
566            Ps = 5  -> Status Report.  Result (``OK'') is
567          CSI 0 n
568            Ps = 6  -> Report Cursor Position (CPR) [row;column].
569          Result is
570          CSI r ; c R
571CSI > Ps n
572          Disable modifiers which may be enabled via the CSI > Ps; Ps m
573          sequence.  This corresponds to a resource value of "-1", which
574          cannot be set with the other sequence.  The parameter identi-
575          fies the resource to be disabled:
576            Ps = 1  -> modifyCursorKeys.
577            Ps = 2  -> modifyFunctionKeys.
578            Ps = 4  -> modifyOtherKeys.
579          If the parameter is omitted, modifyFunctionKeys is disabled.
580          When modifyFunctionKeys is disabled, xterm uses the modifier
581          keys to make an extended sequence of functions rather than
582          adding a parameter to each function key to denote the modi-
583          fiers.
584CSI ? Ps n
585          Device Status Report (DSR, DEC-specific).
586            Ps = 6  -> Report Cursor Position (CPR) [row;column] as CSI
587          ? r ; c R (assumes page is zero).
588            Ps = 1 5  -> Report Printer status as CSI ? 1 0  n  (ready).
589          or CSI ? 1 1  n  (not ready).
590            Ps = 2 5  -> Report UDK status as CSI ? 2 0  n  (unlocked)
591          or CSI ? 2 1  n  (locked).
592            Ps = 2 6  -> Report Keyboard status as
593          CSI ? 2 7  ;  1  ;  0  ;  0  n  (North American).
594          The last two parameters apply to VT400 & up, and denote key-
595          board ready and LK01 respectively.
596            Ps = 5 3  -> Report Locator status as
597          CSI ? 5 3  n  Locator available, if compiled-in, or
598          CSI ? 5 0  n  No Locator, if not.
599CSI > Ps p
600          Set resource value pointerMode.  This is used by xterm to
601          decide whether to hide the pointer cursor as the user types.
602          Valid values for the parameter:
603            Ps = 0  -> never hide the pointer.
604            Ps = 1  -> hide if the mouse tracking mode is not enabled.
605            Ps = 2  -> always hide the pointer.  If no parameter is
606          given, xterm uses the default, which is 1 .
607CSI ! p   Soft terminal reset (DECSTR).
608CSI Ps$ p
609          Request ANSI mode (DECRQM).  For VT300 and up, reply is
610            CSI Ps; Pm$ y
611          where Ps is the mode number as in RM, and Pm is the mode
612          value:
613            0 - not recognized
614            1 - set
615            2 - reset
616            3 - permanently set
617            4 - permanently reset
618CSI ? Ps$ p
619          Request DEC private mode (DECRQM).  For VT300 and up, reply is
620            CSI ? Ps; Pm$ p
621          where Ps is the mode number as in DECSET, Pm is the mode value
622          as in the ANSI DECRQM.
623CSI Ps ; Ps " p
624          Set conformance level (DECSCL).  Valid values for the first
625          parameter:
626            Ps = 6 1  -> VT100.
627            Ps = 6 2  -> VT200.
628            Ps = 6 3  -> VT300.
629          Valid values for the second parameter:
630            Ps = 0  -> 8-bit controls.
631            Ps = 1  -> 7-bit controls (always set for VT100).
632            Ps = 2  -> 8-bit controls.
633CSI Ps q  Load LEDs (DECLL).
634            Ps = 0  -> Clear all LEDS (default).
635            Ps = 1  -> Light Num Lock.
636            Ps = 2  -> Light Caps Lock.
637            Ps = 3  -> Light Scroll Lock.
638            Ps = 2  1  -> Extinguish Num Lock.
639            Ps = 2  2  -> Extinguish Caps Lock.
640            Ps = 2  3  -> Extinguish Scroll Lock.
641CSI Ps SP q
642          Set cursor style (DECSCUSR, VT520).
643            Ps = 0  -> blinking block.
644            Ps = 1  -> blinking block (default).
645            Ps = 2  -> steady block.
646            Ps = 3  -> blinking underline.
647            Ps = 4  -> steady underline.
648CSI Ps " q
649          Select character protection attribute (DECSCA).  Valid values
650          for the parameter:
651            Ps = 0  -> DECSED and DECSEL can erase (default).
652            Ps = 1  -> DECSED and DECSEL cannot erase.
653            Ps = 2  -> DECSED and DECSEL can erase.
654CSI Ps ; Ps r
655          Set Scrolling Region [top;bottom] (default = full size of win-
656          dow) (DECSTBM).
657CSI ? Pm r
658          Restore DEC Private Mode Values.  The value of Ps previously
659          saved is restored.  Ps values are the same as for DECSET.
660CSI Pt; Pl; Pb; Pr; Ps$ r
661          Change Attributes in Rectangular Area (DECCARA), VT400 and up.
662            Pt; Pl; Pb; Pr denotes the rectangle.
663            Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7.
664CSI s     Save cursor (ANSI.SYS).
665CSI ? Pm s
666          Save DEC Private Mode Values.  Ps values are the same as for
667          DECSET.
668CSI Ps ; Ps ; Ps t
669          Window manipulation (from dtterm, as well as extensions).
670          These controls may be disabled using the allowWindowOps
671          resource.  Valid values for the first (and any additional
672          parameters) are:
673            Ps = 1  -> De-iconify window.
674            Ps = 2  -> Iconify window.
675            Ps = 3  ;  x ;  y -> Move window to [x, y].
676            Ps = 4  ;  height ;  width -> Resize the xterm window to
677          height and width in pixels.
678            Ps = 5  -> Raise the xterm window to the front of the stack-
679          ing order.
680            Ps = 6  -> Lower the xterm window to the bottom of the
681          stacking order.
682            Ps = 7  -> Refresh the xterm window.
683            Ps = 8  ;  height ;  width -> Resize the text area to
684          [height;width] in characters.
685            Ps = 9  ;  0  -> Restore maximized window.
686            Ps = 9  ;  1  -> Maximize window (i.e., resize to screen
687          size).
688            Ps = 1 0  ;  0  -> Undo full-screen mode.
689            Ps = 1 0  ;  1  -> Change to full-screen.
690            Ps = 1 1  -> Report xterm window state.  If the xterm window
691          is open (non-iconified), it returns CSI 1 t .  If the xterm
692          window is iconified, it returns CSI 2 t .
693            Ps = 1 3  -> Report xterm window position.  Result is CSI 3
694          ; x ; y t
695            Ps = 1 4  -> Report xterm window in pixels.  Result is CSI
696          4  ;  height ;  width t
697            Ps = 1 8  -> Report the size of the text area in characters.
698          Result is CSI  8  ;  height ;  width t
699            Ps = 1 9  -> Report the size of the screen in characters.
700          Result is CSI  9  ;  height ;  width t
701            Ps = 2 0  -> Report xterm window's icon label.  Result is
702          OSC  L  label ST
703            Ps = 2 1  -> Report xterm window's title.  Result is OSC  l
704          label ST
705            Ps = 2 2  ;  0  -> Save xterm icon and window title on
706          stack.
707            Ps = 2 2  ;  1  -> Save xterm icon title on stack.
708            Ps = 2 2  ;  2  -> Save xterm window title on stack.
709            Ps = 2 3  ;  0  -> Restore xterm icon and window title from
710          stack.
711            Ps = 2 3  ;  1  -> Restore xterm icon title from stack.
712            Ps = 2 3  ;  2  -> Restore xterm window title from stack.
713            Ps >= 2 4  -> Resize to Ps lines (DECSLPP).
714CSI Pt; Pl; Pb; Pr; Ps$ t
715          Reverse Attributes in Rectangular Area (DECRARA), VT400 and
716          up.
717            Pt; Pl; Pb; Pr denotes the rectangle.
718            Ps denotes the attributes to reverse, i.e.,  1, 4, 5, 7.
719CSI > Ps; Ps t
720          Set one or more features of the title modes.  Each parameter
721          enables a single feature.
722            Ps = 0  -> Set window/icon labels using hexadecimal.
723            Ps = 1  -> Query window/icon labels using hexadecimal.
724            Ps = 2  -> Set window/icon labels using UTF-8.
725            Ps = 3  -> Query window/icon labels using UTF-8.  (See dis-
726          cussion of "Title Modes")
727CSI Ps SP t
728          Set warning-bell volume (DECSWBV, VT520).
729            Ps = 0  or 1  -> off.
730            Ps = 2 , 3  or 4  -> low.
731            Ps = 5 , 6 , 7 , or 8  -> high.
732CSI u     Restore cursor (ANSI.SYS).
733CSI Ps SP u
734          Set margin-bell volume (DECSMBV, VT520).
735            Ps = 1  -> off.
736            Ps = 2 , 3  or 4  -> low.
737            Ps = 0 , 5 , 6 , 7 , or 8  -> high.
738CSI Pt; Pl; Pb; Pr; Pp; Pt; Pl; Pp$ v
739          Copy Rectangular Area (DECCRA, VT400 and up).
740            Pt; Pl; Pb; Pr denotes the rectangle.
741            Pp denotes the source page.
742            Pt; Pl denotes the target location.
743            Pp denotes the target page.
744CSI Pt ; Pl ; Pb ; Pr ' w
745          Enable Filter Rectangle (DECEFR), VT420 and up.
746          Parameters are [top;left;bottom;right].
747          Defines the coordinates of a filter rectangle and activates
748          it.  Anytime the locator is detected outside of the filter
749          rectangle, an outside rectangle event is generated and the
750          rectangle is disabled.  Filter rectangles are always treated
751          as "one-shot" events.  Any parameters that are omitted default
752          to the current locator position.  If all parameters are omit-
753          ted, any locator motion will be reported.  DECELR always can-
754          cels any prevous rectangle definition.
755CSI Ps x  Request Terminal Parameters (DECREQTPARM).
756          if Ps is a "0" (default) or "1", and xterm is emulating VT100,
757          the control sequence elicits a response of the same form whose
758          parameters describe the terminal:
759            Ps -> the given Ps incremented by 2.
760            Pn = 1  <- no parity.
761            Pn = 1  <- eight bits.
762            Pn = 1  <- 2  8  transmit 38.4k baud.
763            Pn = 1  <- 2  8  receive 38.4k baud.
764            Pn = 1  <- clock multiplier.
765            Pn = 0  <- STP flags.
766CSI Ps x  Select Attribute Change Extent (DECSACE).
767            Ps = 0  -> from start to end position, wrapped.
768            Ps = 1  -> from start to end position, wrapped.
769            Ps = 2  -> rectangle (exact).
770CSI Pc; Pt; Pl; Pb; Pr$ x
771          Fill Rectangular Area (DECFRA), VT420 and up.
772            Pc is the character to use.
773            Pt; Pl; Pb; Pr denotes the rectangle.
774CSI Ps ; Pu ' z
775          Enable Locator Reporting (DECELR).
776          Valid values for the first parameter:
777            Ps = 0  -> Locator disabled (default).
778            Ps = 1  -> Locator enabled.
779            Ps = 2  -> Locator enabled for one report, then disabled.
780          The second parameter specifies the coordinate unit for locator
781          reports.
782          Valid values for the second parameter:
783            Pu = 0  <- or omitted -> default to character cells.
784            Pu = 1  <- device physical pixels.
785            Pu = 2  <- character cells.
786CSI Pt; Pl; Pb; Pr$ z
787          Erase Rectangular Area (DECERA), VT400 and up.
788            Pt; Pl; Pb; Pr denotes the rectangle.
789CSI Pm ' {
790          Select Locator Events (DECSLE).
791          Valid values for the first (and any additional parameters)
792          are:
793            Ps = 0  -> only respond to explicit host requests (DECRQLP).
794                       (This is default).  It also cancels any filter
795          rectangle.
796            Ps = 1  -> report button down transitions.
797            Ps = 2  -> do not report button down transitions.
798            Ps = 3  -> report button up transitions.
799            Ps = 4  -> do not report button up transitions.
800CSI Pt; Pl; Pb; Pr$ {
801          Selective Erase Rectangular Area (DECSERA), VT400 and up.
802            Pt; Pl; Pb; Pr denotes the rectangle.
803CSI Ps ' |
804          Request Locator Position (DECRQLP).
805          Valid values for the parameter are:
806            Ps = 0 , 1 or omitted -> transmit a single DECLRP locator
807          report.
808
809          If Locator Reporting has been enabled by a DECELR, xterm will
810          respond with a DECLRP Locator Report.  This report is also
811          generated on button up and down events if they have been
812          enabled with a DECSLE, or when the locator is detected outside
813          of a filter rectangle, if filter rectangles have been enabled
814          with a DECEFR.
815
816            -> CSI Pe ; Pb ; Pr ; Pc ; Pp &  w
817
818          Parameters are [event;button;row;column;page].
819          Valid values for the event:
820            Pe = 0  -> locator unavailable - no other parameters sent.
821            Pe = 1  -> request - xterm received a DECRQLP.
822            Pe = 2  -> left button down.
823            Pe = 3  -> left button up.
824            Pe = 4  -> middle button down.
825            Pe = 5  -> middle button up.
826            Pe = 6  -> right button down.
827            Pe = 7  -> right button up.
828            Pe = 8  -> M4 button down.
829            Pe = 9  -> M4 button up.
830            Pe = 1 0  -> locator outside filter rectangle.
831          ``button'' parameter is a bitmask indicating which buttons are
832          pressed:
833            Pb = 0  <- no buttons down.
834            Pb & 1  <- right button down.
835            Pb & 2  <- middle button down.
836            Pb & 4  <- left button down.
837            Pb & 8  <- M4 button down.
838          ``row'' and ``column'' parameters are the coordinates of the
839          locator position in the xterm window, encoded as ASCII deci-
840          mal.
841          The ``page'' parameter is not used by xterm, and will be omit-
842          ted.
843
844Operating System Controls
845OSC Ps ; Pt ST
846OSC Ps ; Pt BEL
847          Set Text Parameters.  For colors and font, if Pt is a "?", the
848          control sequence elicits a response which consists of the con-
849          trol sequence which would set the corresponding value.  The
850          dtterm control sequences allow you to determine the icon name
851          and window title.
852            Ps = 0  -> Change Icon Name and Window Title to Pt.
853            Ps = 1  -> Change Icon Name to Pt.
854            Ps = 2  -> Change Window Title to Pt.
855            Ps = 3  -> Set X property on top-level window.  Pt should be
856          in the form "prop=value", or just "prop" to delete the prop-
857          erty
858            Ps = 4  ; c ; spec -> Change Color Number c to the color
859          specified by spec.  This can be a name or RGB specification as
860          per XParseColor.  Any number of c name pairs may be given.
861          The color numbers correspond to the ANSI colors 0-7, their
862          bright versions 8-15, and if supported, the remainder of the
863          88-color or 256-color table.
864
865          If a "?" is given rather than a name or RGB specification,
866          xterm replies with a control sequence of the same form which
867          can be used to set the corresponding color.  Because more than
868          one pair of color number and specification can be given in one
869          control sequence, xterm can make more than one reply.
870
871            Ps = 5  ; c ; spec -> Change Special Color Number c to the
872          color specified by spec.  This can be a name or RGB specifica-
873          tion as per XParseColor.  Any number of c name pairs may be
874          given.  The special colors can also be set by adding the maxi-
875          mum number of colors to these codes in an OSC 4  control:
876
877            Pc = 0  <- resource colorBD (BOLD).
878            Pc = 1  <- resource colorUL (UNDERLINE).
879            Pc = 2  <- resource colorBL (BLINK).
880            Pc = 3  <- resource colorRV (REVERSE).
881
882          The 8 colors (below) which may be set or queried using 1 0
883          through 1 7  are denoted dynamic colors, since the correspond-
884          ing control sequences were the first means for setting xterm's
885          colors dynamically, i.e., after it was started.  They are not
886          the same as the ANSI colors.  These controls may be disabled
887          using the allowColorOps resource.  At least one parameter is
888          expected for Pt.  Each successive parameter changes the next
889          color in the list.  The value of Ps tells the starting point
890          in the list.  The colors are specified by name or RGB specifi-
891          cation as per XParseColor.
892
893          If a "?" is given rather than a name or RGB specification,
894          xterm replies with a control sequence of the same form which
895          can be used to set the corresponding dynamic color.  Because
896          more than one pair of color number and specification can be
897          given in one control sequence, xterm can make more than one
898          reply.
899
900            Ps = 1 0  -> Change VT100 text foreground color to Pt.
901            Ps = 1 1  -> Change VT100 text background color to Pt.
902            Ps = 1 2  -> Change text cursor color to Pt.
903            Ps = 1 3  -> Change mouse foreground color to Pt.
904            Ps = 1 4  -> Change mouse background color to Pt.
905            Ps = 1 5  -> Change Tektronix foreground color to Pt.
906            Ps = 1 6  -> Change Tektronix background color to Pt.
907            Ps = 1 7  -> Change highlight background color to Pt.
908            Ps = 1 8  -> Change Tektronix cursor color to Pt.
909            Ps = 1 9  -> Change highlight foreground color to Pt.
910
911            Ps = 4 6  -> Change Log File to Pt.  (This is normally dis-
912          abled by a compile-time option).
913
914            Ps = 5 0  -> Set Font to Pt.  These controls may be disabled
915          using the allowFontOps resource.  If Pt begins with a "#",
916          index in the font menu, relative (if the next character is a
917          plus or minus sign) or absolute.  A number is expected but not
918          required after the sign (the default is the current entry for
919          relative, zero for absolute indexing).
920          The same rule (plus or minus sign, optional number) is used
921          when querying the font.  The remainder of Pt is ignored.
922          A font can be specified after a "#" index expression, by
923          adding a space and then the font specifier.
924          If the "TrueType Fonts" menu entry is set (the renderFont
925          resource), then this control sets/queries the faceName
926          resource.
927
928            Ps = 5 1  (reserved for Emacs shell).
929
930            Ps = 5 2  -> Manipulate Selection Data.  These controls may
931          be disabled using the allowWindowOps resource.  The parameter
932          Pt is parsed as
933               Pc; Pd
934          The first, Pc, may contain any character from the set c  p  s
935          0  1  2  3  4  5  6  7 .  It is used to construct a list of
936          selection parameters for clipboard, primary, select, or cut
937          buffers 0 through 8 respectively, in the order given.  If the
938          parameter is empty, xterm uses s 0 , to specify the config-
939          urable primary/clipboard selection and cut buffer 0.
940          The second parameter, Pd, gives the selection data.  Normally
941          this is a string encoded in base64.  The data becomes the new
942          selection, which is then available for pasting by other appli-
943          cations.
944          If the second parameter is a ? , xterm replies to the host
945          with the selection data encoded using the same protocol.
946
947            Ps = 1 0 4  ; c -> Reset Color Number c.  It is reset to the
948          color specified by the corresponding X resource.  Any number
949          of c parameters may be given.  These parameters correspond to
950          the ANSI colors 0-7, their bright versions 8-15, and if sup-
951          ported, the remainder of the 88-color or 256-color table.  If
952          no parameters are given, the entire table will be reset.
953
954            Ps = 1 0 5  ; c -> Reset Special Color Number c.  It is
955          reset to the color specified by the corresponding X resource.
956          Any number of c parameters may be given.  These parameters
957          correspond to the special colors which can be set using an OSC
958          5  control (or by adding the maximum number of colors using an
959          OSC 4  control).
960
961          The dynamic colors can also be reset to their default
962          (resource) values:
963            Ps = 1 1 0  -> Reset VT100 text foreground color.
964            Ps = 1 1 1  -> Reset VT100 text background color.
965            Ps = 1 1 2  -> Reset text cursor color.
966            Ps = 1 1 3  -> Reset mouse foreground color.
967            Ps = 1 1 4  -> Reset mouse background color.
968            Ps = 1 1 5  -> Reset Tektronix foreground color.
969            Ps = 1 1 6  -> Reset Tektronix background color.
970            Ps = 1 1 7  -> Reset highlight color.
971            Ps = 1 1 8  -> Reset Tektronix cursor color.
972
973Privacy Message
974PM Pt ST  xterm implements no PM  functions; Pt is ignored.  Pt need not
975          be printable characters.
976
977Alt and Meta Keys
978Many keyboards have keys labeled "Alt".  Few have keys labeled "Meta".
979However, xterm's default translations use the Meta modifier.  Common
980keyboard configurations assign the Meta modifier to an "Alt" key.  By
981using xmodmap one may have the modifier assigned to a different key, and
982have "real" alt and meta keys.  Here is an example:
983
984             ! put meta on mod3 to distinguish it from alt
985             keycode 64 = Alt_L
986             clear mod1
987             add mod1 = Alt_L
988             keycode 115 = Meta_L
989             clear mod3
990             add mod3 = Meta_L
991
992
993The metaSendsEscape resource (and altSendsEscape if altIsNotMeta is set)
994can be used to control the way the Meta modifier applies to ordinary
995keys unless the modifyOtherKeys resource is set:
996          - prefix a key with the ESC  character.
997          - shift the key from codes 0-127 to 128-255 by adding 128.
998
999The table shows the result for a given character "x" with modifiers
1000according to the default translations with the resources set on or off.
1001This assumes altIsNotMeta is set:
1002
1003       -----------------------------------------------------------
1004       key          altSendsEscape   metaSendsEscape   result
1005       -----------------------------------------------------------
1006       x            off              off               x
1007       Meta-x       off              off               shift
1008       Alt-x        off              off               shift
1009       Alt+Meta-x   off              off               shift
1010       x            ON               off               x
1011       Meta-x       ON               off               shift
1012       Alt-x        ON               off               ESC  x
1013       Alt+Meta-x   ON               off               ESC  shift
1014       x            off              ON                x
1015       Meta-x       off              ON                ESC  x
1016       Alt-x        off              ON                shift
1017       Alt+Meta-x   off              ON                ESC  shift
1018       x            ON               ON                x
1019       Meta-x       ON               ON                ESC  x
1020       Alt-x        ON               ON                ESC  x
1021       Alt+Meta-x   ON               ON                ESC  x
1022       -----------------------------------------------------------
1023
1024
1025PC-Style Function Keys
1026If xterm does minimal translation of the function keys, it usually does
1027this with a PC-style keyboard, so PC-style function keys result.  Sun
1028keyboards are similar to PC keyboards.  Both have cursor and scrolling
1029operations printed on the keypad, which duplicate the smaller cursor and
1030scrolling keypads.
1031
1032X does not predefine NumLock (used for VT220 keyboards) or Alt (used as
1033an extension for the Sun/PC keyboards) as modifiers.  These keys are
1034recognized as modifiers when enabled by the numLock resource, or by the
1035"DECSET 1 0 3 5 " control sequence.
1036
1037The cursor keys transmit the following escape sequences depending on the
1038mode specified via the DECCKM escape sequence.
1039
1040                      Key         Normal    Application
1041                  --------------------------------------
1042                  Cursor Up      CSI A      SS3 A
1043                  Cursor Down    CSI B      SS3 B
1044                  Cursor Right   CSI C      SS3 C
1045                  Cursor Left    CSI D      SS3 D
1046                  --------------------------------------
1047
1048The home- and end-keys (unlike PageUp and other keys also on the 6-key
1049editing keypad) are considered "cursor keys" by xterm.  Their mode is
1050also controlled by the DECCKM escape sequence:
1051
1052                      Key       Normal    Application
1053                    ----------------------------------
1054                    Home       CSI H      SS3 H
1055                    End        CSI F      SS3 F
1056                    ----------------------------------
1057
1058
1059The application keypad transmits the following escape sequences depend-
1060ing on the mode specified via the DECPNM and DECPAM escape sequences.
1061Use the NumLock key to override the application mode.
1062
1063Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are
1064supported by the program.
1065
1066           Key         Numeric    Application   Terminfo   Termcap
1067      --------------------------------------------------------------
1068      Space            SP         SS3 SP        -          -
1069      Tab              TAB        SS3 I         -          -
1070      Enter            CR         SS3 M         kent       @8
1071      PF1              SS3 P      SS3 P         kf1        k1
1072      PF2              SS3 Q      SS3 Q         kf2        k2
1073      PF3              SS3 R      SS3 R         kf3        k3
1074      PF4              SS3 S      SS3 S         kf4        k4
1075      * (multiply)     *          SS3 j         -          -
1076      + (add)          +          SS3 k         -          -
1077      , (comma)        ,          SS3 l         -          -
1078      - (minus)        -          SS3 m         -          -
1079      . (Delete)       .          CSI 3 ~       -          -
1080      / (divide)       /          SS3 o         -          -
1081      0 (Insert)       0          CSI 2 ~       -          -
1082      1 (End)          1          SS3 F         kc1        K4
1083      2 (DownArrow)    2          CSI B         -          -
1084      3 (PageDown)     3          CSI 6 ~       kc3        K5
1085      4 (LeftArrow)    4          CSI D         -          -
1086      5 (Begin)        5          CSI E         kb2        K2
1087      6 (RightArrow)   6          CSI C         -          -
1088      7 (Home)         7          SS3 H         ka1        K1
1089      8 (UpArrow)      8          CSI A         -          -
1090      9 (PageUp)       9          CSI 5 ~       ka3        K3
1091      = (equal)        =          SS3 X         -          -
1092      --------------------------------------------------------------
1093
1094They also provide 12 function keys, as well as a few other special-pur-
1095pose keys:
1096
1097                         Key      Escape Sequence
1098                       ---------------------------
1099                       F1         SS3 P
1100                       F2         SS3 Q
1101                       F3         SS3 R
1102                       F4         SS3 S
1103                       F5         CSI 1 5 ~
1104                       F6         CSI 1 7 ~
1105                       F7         CSI 1 8 ~
1106                       F8         CSI 1 9 ~
1107                       F9         CSI 2 0 ~
1108                       F10        CSI 2 1 ~
1109                       F11        CSI 2 3 ~
1110                       F12        CSI 2 4 ~
1111                       ---------------------------
1112
1113
1114Older versions of xterm implement different escape sequences for F1
1115through F4.  These can be activated by setting the oldXtermFKeys
1116resource.  However, since they do not correspond to any hardware termi-
1117nal, they have been deprecated.  (The DEC VT220 reserves F1 through F5
1118for local functions such as Setup).
1119
1120                         Key      Escape Sequence
1121                       ---------------------------
1122                       F1         CSI 1 1 ~
1123                       F2         CSI 1 2 ~
1124                       F3         CSI 1 3 ~
1125                       F4         CSI 1 4 ~
1126                       ---------------------------
1127
1128In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is
1129false, xterm recognizes function key modifiers which are parameters
1130appended before the final character of the control sequence.
1131
1132                      Code     Modifiers
1133                    ---------------------------------
1134                       2       Shift
1135                       3       Alt
1136                       4       Shift + Alt
1137                       5       Control
1138                       6       Shift + Control
1139                       7       Alt + Control
1140                       8       Shift + Alt + Control
1141                    ---------------------------------
1142
1143For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
1144
1145If the alwaysUseMods resource is set, the Meta modifier also is recog-
1146nized, making parameters 9 through 16.
1147
1148VT220-Style Function Keys
1149However, xterm is most useful as a DEC VT102 or VT220 emulator.  Set the
1150sunKeyboard resource to true to force a Sun/PC keyboard to act like a
1151VT220 keyboard.
1152
1153The VT102/VT220 application keypad transmits unique escape sequences in
1154application mode, which are distinct from the cursor and scrolling key-
1155pad:
1156
1157                      Key        Numeric    Application
1158                  --------------------------------------
1159                  Space          SP         SS3 SP
1160                  Tab            TAB        SS3 I
1161                  Enter          CR         SS3 M
1162                  PF1            SS3 P      SS3 P
1163                  PF2            SS3 Q      SS3 Q
1164                  PF3            SS3 R      SS3 R
1165                  PF4            SS3 S      SS3 S
1166                  * (multiply)   *          SS3 j
1167                  + (add)        +          SS3 k
1168                  , (comma)      ,          SS3 l
1169                  - (minus)      -          SS3 m
1170                  . (period)     .          SS3 n
1171                  / (divide)     /          SS3 o
1172                  0              0          SS3 p
1173                  1              1          SS3 q
1174                  2              2          SS3 r
1175                  3              3          SS3 s
1176                  4              4          SS3 t
1177                  5              5          SS3 u
1178                  6              6          SS3 v
1179                  7              7          SS3 w
1180                  8              8          SS3 x
1181                  9              9          SS3 y
1182                  = (equal)      =          SS3 X
1183                  --------------------------------------
1184
1185The VT220 provides a 6-key editing keypad, which is analogous to that on
1186the PC keyboard.  It is not affected by DECCKM or DECPNM/DECPAM:
1187
1188                     Key       Normal    Application
1189                   ----------------------------------
1190                   Insert     CSI 2 ~    CSI 2 ~
1191                   Delete     CSI 3 ~    CSI 3 ~
1192                   Home       CSI 1 ~    CSI 1 ~
1193                   End        CSI 4 ~    CSI 4 ~
1194                   PageUp     CSI 5 ~    CSI 5 ~
1195                   PageDown   CSI 6 ~    CSI 6 ~
1196                   ----------------------------------
1197
1198The VT220 provides 8 additional function keys.  With a Sun/PC keyboard,
1199access these keys by Control/F1 for F13, etc.
1200
1201                         Key      Escape Sequence
1202                       ---------------------------
1203                       F13        CSI 2 5 ~
1204                       F14        CSI 2 6 ~
1205                       F15        CSI 2 8 ~
1206                       F16        CSI 2 9 ~
1207                       F17        CSI 3 1 ~
1208                       F18        CSI 3 2 ~
1209                       F19        CSI 3 3 ~
1210                       F20        CSI 3 4 ~
1211                       ---------------------------
1212
1213
1214VT52-Style Function Keys
1215A VT52 does not have function keys, but it does have a numeric keypad
1216and cursor keys.  They differ from the other emulations by the prefix.
1217Also, the cursor keys do not change:
1218
1219                       Key        Normal/Application
1220                   ----------------------------------
1221                   Cursor Up      ESC A
1222                   Cursor Down    ESC B
1223                   Cursor Right   ESC C
1224                   Cursor Left    ESC D
1225                   ----------------------------------
1226
1227The keypad is similar:
1228
1229                      Key        Numeric    Application
1230                  --------------------------------------
1231                  Space          SP         ESC ? SP
1232                  Tab            TAB        ESC ? I
1233                  Enter          CR         ESC ? M
1234                  PF1            ESC P      ESC P
1235                  PF2            ESC Q      ESC Q
1236                  PF3            ESC R      ESC R
1237                  PF4            ESC S      ESC S
1238                  * (multiply)   *          ESC ? j
1239                  + (add)        +          ESC ? k
1240                  , (comma)      ,          ESC ? l
1241                  - (minus)      -          ESC ? m
1242                  . (period)     .          ESC ? n
1243                  / (divide)     /          ESC ? o
1244                  0              0          ESC ? p
1245                  1              1          ESC ? q
1246                  2              2          ESC ? r
1247                  3              3          ESC ? s
1248                  4              4          ESC ? t
1249                  5              5          ESC ? u
1250                  6              6          ESC ? v
1251                  7              7          ESC ? w
1252                  8              8          ESC ? x
1253                  9              9          ESC ? y
1254                  = (equal)      =          ESC ? X
1255                  --------------------------------------
1256
1257
1258Sun-Style Function Keys
1259The xterm program provides support for Sun keyboards more directly, by a
1260menu toggle that causes it to send Sun-style function key codes rather
1261than VT220.  Note, however, that the sun and VT100 emulations are not
1262really compatible.  For example, their wrap-margin behavior differs.
1263
1264Only function keys are altered; keypad and cursor keys are the same.
1265The emulation responds identically.  See the xterm-sun terminfo entry
1266for details.
1267
1268HP-Style Function Keys
1269Similarly, xterm can be compiled to support HP keyboards.  See the
1270xterm-hp terminfo entry for details.
1271
1272The Alternate Screen Buffer
1273Xterm maintains two screen buffers.  The normal screen buffer allows you
1274to scroll back to view saved lines of output up to the maximum set by
1275the saveLines resource.  The alternate screen buffer is exactly as large
1276as the display, contains no additional saved lines.  When the alternate
1277screen buffer is active, you cannot scroll back to view saved lines.
1278Xterm provides control sequences and menu entries for switching between
1279the two.
1280
1281Most full-screen applications use terminfo or termcap to obtain strings
1282used to start/stop full-screen mode, i.e., smcup and rmcup for terminfo,
1283or the corresponding ti and te for termcap.  The titeInhibit resource
1284removes the ti and te strings from the TERMCAP string which is set in
1285the environment for some platforms.  That is not done when xterm is
1286built with terminfo libraries because terminfo does not provide the
1287whole text of the termcap data in one piece.  It would not work for ter-
1288minfo anyway, since terminfo data is not passed in environment vari-
1289ables; setting an environment variable in this manner would have no
1290effect on the application's ability to switch between normal and alter-
1291nate screen buffers.  Instead, the newer private mode controls (such as
12921 0 4 9 ) for switching between normal and alternate screen buffers sim-
1293ply disable the switching.  They add other features such as clearing the
1294display for the same reason: to make the details of switching indepen-
1295dent of the application that requests the switch.
1296
1297Bracketed Paste Mode
1298When bracketed paste mode is set, pasted text is bracketed with control
1299sequences so that the program can differentiate pasted text from typed-
1300in text.  When bracketed paste mode is set, the program will receive:
1301   ESC [ 200 ~,
1302followed by the pasted text, followed by
1303   ESC [ 201 ~.
1304
1305Title Modes
1306The window- and icon-labels can be set or queried using control
1307sequences.  As a VT220-emulator, xterm "should" limit the character
1308encoding for the corresponding strings to ISO-8859-1.  Indeed, it used
1309to be the case (and was documented) that window titles had to be
1310ISO-8859-1.  This is no longer the case.  However, there are many appli-
1311cations which still assume that titles are set using ISO-8859-1.  So
1312that is the default behavior.
1313
1314If xterm is running with UTF-8 encoding, it is possible to use window-
1315and icon-labels encoded using UTF-8.  That is because the underlying X
1316libraries (and many, but not all) window managers support this feature.
1317
1318The utf8Title X resource setting tells xterm to disable a reconversion
1319of the title string back to ISO-8859-1, allowing the title strings to be
1320interpreted as UTF-8.  The same feature can be enabled using the title
1321mode control sequence described in this summary.
1322
1323Separate from the ability to set the titles, xterm provides the ability
1324to query the titles, returning them either in ISO-8859-1 or UTF-8.  This
1325choice is available only while xterm is using UTF-8 encoding.
1326
1327Finally, the characters sent to, or returned by a title control are less
1328constrained than the rest of the control sequences.  To make them more
1329manageable (and constrained), for use in shell scripts, xterm has an
1330optional feature which decodes the string from hexadecimal (for setting
1331titles) or for encoding the title into hexadecimal when querying the
1332value.
1333
1334Mouse Tracking
1335The VT widget can be set to send the mouse position and other informa-
1336tion on button presses.  These modes are typically used by editors and
1337other full-screen applications that want to make use of the mouse.
1338
1339There are six mutually exclusive modes.  One is DEC Locator mode,
1340enabled by the DECELR CSI Ps ; Ps  '  z control sequence, and is not
1341described here (control sequences are summarized above).  The remaining
1342five modes are each enabled (or disabled) by a different parameter in
1343the "DECSET CSI ? Pm h " or "DECRST CSI ? Pm l " control sequence.
1344
1345Manifest constants for the parameter values are defined in xcharmouse.h
1346as follows:
1347
1348                #define SET_X10_MOUSE               9
1349                #define SET_VT200_MOUSE             1000
1350                #define SET_VT200_HIGHLIGHT_MOUSE   1001
1351                #define SET_BTN_EVENT_MOUSE         1002
1352                #define SET_ANY_EVENT_MOUSE         1003
1353
1354                #define SET_FOCUS_EVENT_MOUSE       1004
1355
1356                #define SET_EXT_MODE_MOUSE          1005
1357
1358The motion reporting modes are strictly xterm extensions, and are not
1359part of any standard, though they are analogous to the DEC VT200 DECELR
1360locator reports.
1361
1362Parameters (such as pointer position and button number) for all mouse
1363tracking escape sequences generated by xterm encode numeric parameters
1364in a single character as value+32.  For example, !  specifies the value
13651.  The upper left character position on the terminal is denoted as 1,1.
1366
1367X10 compatibility mode sends an escape sequence only on button press,
1368encoding the location and the mouse button pressed.  It is enabled by
1369specifying parameter 9 to DECSET.  On button press, xterm sends CSI M
1370CbCxCy (6 characters).
1371o   Cb is button-1.
1372o   Cx and Cy are the x and y coordinates of the mouse when the button
1373    was pressed.
1374
1375Normal tracking mode sends an escape sequence on both button press and
1376release.  Modifier key (shift, ctrl, meta) information is also sent.  It
1377is enabled by specifying parameter 1000 to DECSET.  On button press or
1378release, xterm sends CSI M CbCxCy.
1379o   The low two bits of Cb encode button information: 0=MB1 pressed,
1380    1=MB2 pressed, 2=MB3 pressed, 3=release.
1381o   The next three bits encode the modifiers which were down when the
1382    button was pressed and are added together:  4=Shift, 8=Meta, 16=Con-
1383    trol.  Note however that the shift and control bits are normally
1384    unavailable because xterm uses the control modifier with mouse for
1385    popup menus, and the shift modifier is used in the default transla-
1386    tions for button events.  The Meta modifier recognized by xterm is
1387    the mod1 mask, and is not necessarily the "Meta" key (see xmodmap).
1388o   Cx and Cy are the x and y coordinates of the mouse event, encoded as
1389    in X10 mode.
1390
1391Wheel mice may return buttons 4 and 5.  Those buttons are represented by
1392the same event codes as buttons 1 and 2 respectively, except that 64 is
1393added to the event code.  Release events for the wheel buttons are not
1394reported.
1395
1396Mouse highlight tracking notifies a program of a button press, receives
1397a range of lines from the program, highlights the region covered by the
1398mouse within that range until button release, and then sends the program
1399the release coordinates.  It is enabled by specifying parameter 1001 to
1400DECSET.  Highlighting is performed only for button 1, though other but-
1401ton events can be received.
1402
1403Warning: use of this mode requires a cooperating program or it will hang
1404xterm.
1405
1406On button press, the same information as for normal tracking is gener-
1407ated; xterm then waits for the program to send mouse tracking informa-
1408tion.  All X events are ignored until the proper escape sequence is
1409received from the pty: CSI Ps ; Ps ; Ps ; Ps ; Ps T .  The parameters
1410are func, startx, starty, firstrow, and lastrow.  func is non-zero to
1411initiate highlight tracking and zero to abort.  startx and starty give
1412the starting x and y location for the highlighted region.  The ending
1413location tracks the mouse, but will never be above row firstrow and will
1414always be above row lastrow.  (The top of the screen is row 1.)  When
1415the button is released, xterm reports the ending position one of two
1416ways:
1417o   if the start and end coordinates are the same locations:
1418    CSI t CxCy.
1419o   otherwise:
1420    CSI T CxCyCxCyCxCy.
1421    The parameters are startx, starty, endx, endy, mousex, and mousey.
1422    -    startx, starty, endx, and endy give the starting and ending
1423         character positions of the region.
1424    -    mousex and mousey give the location of the mouse at button up,
1425         which may not be over a character.
1426
1427Button-event tracking is essentially the same as normal tracking, but
1428xterm also reports button-motion events.  Motion events are reported
1429only if the mouse pointer has moved to a different character cell.  It
1430is enabled by specifying parameter 1002 to DECSET.  On button press or
1431release, xterm sends the same codes used by normal tracking mode.
1432o   On button-motion events, xterm adds 32 to the event code (the third
1433    character, Cb).
1434o   The other bits of the event code specify button and modifier keys as
1435    in normal mode.  For example, motion into cell x,y with button 1
1436    down is reported as CSI M @ CxCy.  ( @  = 32 + 0 (button 1) + 32
1437    (motion indicator) ).  Similarly, motion with button 3 down is
1438    reported as CSI M B CxCy.  ( B  = 32 + 2 (button 3) + 32 (motion
1439    indicator) ).
1440
1441Any-event mode is the same as button-event mode, except that all motion
1442events are reported, even if no mouse button is down.  It is enabled by
1443specifying 1003 to DECSET.
1444
1445FocusIn/FocusOut can be combined with any of the mouse events since it
1446uses a different protocol.  When set, it causes xterm to send CSI I
1447when the terminal gains focus, and CSI O  when it loses focus.
1448
1449Extended mouse mode enables UTF-8 encoding for Cx and Cy under all
1450tracking modes, expanding the maximum encodable position from 223 to
14512015.  For positions less than 95, the resulting output is identical
1452under both modes.  Under extended mouse mode, positions greater than 95
1453generate "extra" bytes which will confuse applications which do not
1454treat their input as a UTF-8 stream.  Likewise, Cb will be UTF-8
1455encoded, to reduce confusion with wheel mouse events.
1456
1457NOTE: Under normal mouse mode, positions outside (160,94) result in byte
1458pairs which can be interpreted as a single UTF-8 character; applications
1459which do treat their input as UTF-8 will almost certainly be confused
1460unless extended mouse mode is active.
1461
1462Tektronix 4014 Mode
1463Most of these sequences are standard Tektronix 4014 control sequences.
1464Graph mode supports the 12-bit addressing of the Tektronix 4014.  The
1465major features missing are the write-through and defocused modes.  This
1466document does not describe the commands used in the various Tektronix
1467plotting modes but does describe the commands to switch modes.
1468
1469BEL       Bell (Ctrl-G).
1470BS        Backspace (Ctrl-H).
1471TAB       Horizontal Tab (Ctrl-I).
1472LF        Line Feed or New Line (Ctrl-J).
1473VT        Cursor up (Ctrl-K).
1474FF        Form Feed or New Page (Ctrl-L).
1475CR        Carriage Return (Ctrl-M).
1476ESC ETX   Switch to VT100 Mode (ESC Ctrl-C).
1477ESC ENQ   Return Terminal Status (ESC Ctrl-E).
1478ESC FF    PAGE (Clear Screen) (ESC Ctrl-L).
1479ESC SO    Begin 4015 APL mode (ESC Ctrl-N).  (This is ignored by xterm).
1480ESC SI    End 4015 APL mode (ESC Ctrl-O).  (This is ignored by xterm).
1481ESC ETB   COPY (Save Tektronix Codes to file COPYyyyy-mm-dd.hh:mm:ss).
1482            ETB  (end transmission block) is the same as Ctrl-W.
1483ESC CAN   Bypass Condition (ESC Ctrl-X).
1484ESC SUB   GIN mode (ESC Ctrl-Z).
1485ESC FS    Special Point Plot Mode (ESC Ctrl-\).
1486ESC 8     Select Large Character Set.
1487ESC 9     Select #2 Character Set.
1488ESC :     Select #3 Character Set.
1489ESC ;     Select Small Character Set.
1490OSC Ps ; Pt BEL
1491          Set Text Parameters of VT window.
1492            Ps = 0  -> Change Icon Name and Window Title to Pt.
1493            Ps = 1  -> Change Icon Name to Pt.
1494            Ps = 2  -> Change Window Title to Pt.
1495            Ps = 4 6  -> Change Log File to Pt.  (This is normally dis-
1496          abled by a compile-time option).
1497ESC `     Normal Z Axis and Normal (solid) Vectors.
1498ESC a     Normal Z Axis and Dotted Line Vectors.
1499ESC b     Normal Z Axis and Dot-Dashed Vectors.
1500ESC c     Normal Z Axis and Short-Dashed Vectors.
1501ESC d     Normal Z Axis and Long-Dashed Vectors.
1502ESC h     Defocused Z Axis and Normal (solid) Vectors.
1503ESC i     Defocused Z Axis and Dotted Line Vectors.
1504ESC j     Defocused Z Axis and Dot-Dashed Vectors.
1505ESC k     Defocused Z Axis and Short-Dashed Vectors.
1506ESC l     Defocused Z Axis and Long-Dashed Vectors.
1507ESC p     Write-Thru Mode and Normal (solid) Vectors.
1508ESC q     Write-Thru Mode and Dotted Line Vectors.
1509ESC r     Write-Thru Mode and Dot-Dashed Vectors.
1510ESC s     Write-Thru Mode and Short-Dashed Vectors.
1511ESC t     Write-Thru Mode and Long-Dashed Vectors.
1512FS        Point Plot Mode (Ctrl-\).
1513GS        Graph Mode (Ctrl-]).
1514RS        Incremental Plot Mode (Ctrl-^).
1515US        Alpha Mode (Ctrl-_).
1516
1517VT52 Mode
1518Parameters for cursor movement are at the end of the ESC Y  escape
1519sequence.  Each ordinate is encoded in a single character as value+32.
1520For example, !  is 1.  The screen coordinate system is 0-based.
1521
1522ESC A     Cursor up.
1523ESC B     Cursor down.
1524ESC C     Cursor right.
1525ESC D     Cursor left.
1526ESC F     Enter graphics mode.
1527ESC G     Exit graphics mode.
1528ESC H     Move the cursor to the home position.
1529ESC I     Reverse line feed.
1530ESC J     Erase from the cursor to the end of the screen.
1531ESC K     Erase from the cursor to the end of the line.
1532ESC Y Ps Ps
1533          Move the cursor to given row and column.
1534ESC Z     Identify.
1535            -> ESC  /  Z  (``I am a VT52.'').
1536ESC =     Enter alternate keypad mode.
1537ESC >     Exit alternate keypad mode.
1538ESC <     Exit VT52 mode (Enter VT100 mode).
1539