ctlseqs.txt revision e39b573c
11.3Spgoyette
21.1Spgoyette
31.1Spgoyette
41.1Spgoyette
51.1Spgoyette
61.1Spgoyette
71.1Spgoyette
81.1Spgoyette
91.1Spgoyette
101.1Spgoyette                        Xterm Control Sequences
111.1Spgoyette
121.1Spgoyette
131.1Spgoyette                               Edward Moy
141.1Spgoyette                   University of California, Berkeley
151.1Spgoyette
161.1Spgoyette                               Revised by
171.1Spgoyette
181.1Spgoyette                             Stephen Gildea
191.1Spgoyette                          X Consortium (1994)
201.1Spgoyette
211.1Spgoyette                             Thomas Dickey
221.1Spgoyette                      XFree86 Project (1996-2006)
231.1Spgoyette                    invisible-island.net (2006-2011)
241.1Spgoyette
251.1Spgoyette
261.1Spgoyette
271.1SpgoyetteDefinitions
281.1Spgoyette
291.1Spgoyettec    The literal character c.
301.1Spgoyette
311.1SpgoyetteC    A single (required) character.
321.1Spgoyette
331.1SpgoyettePs   A single (usually optional) numeric parameter, composed of one of
341.1Spgoyette     more digits.
351.1Spgoyette
361.1SpgoyettePm   A multiple numeric parameter composed of any number of single
371.1Spgoyette     numeric parameters, separated by ;  character(s).  Individual val-
381.1Spgoyette     ues for the parameters are listed with Ps .
391.1Spgoyette
401.1SpgoyettePt   A text parameter composed of printable characters.
411.1Spgoyette
421.2SwizC1 (8-Bit) Control Characters
431.1Spgoyette
441.3SpgoyetteThe xterm program recognizes both 8-bit and 7-bit control characters.
451.2SwizIt generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
461.1SpgoyetteThe following pairs of 7-bit and 8-bit control characters are equiva-
471.1Spgoyettelent:
481.2Swiz
491.3SpgoyetteESC D
501.2Swiz     Index (IND  is 0x84).
511.2SwizESC E
521.2Swiz     Next Line (NEL  is 0x85).
531.1SpgoyetteESC H
541.1Spgoyette     Tab Set (HTS  is 0x88).
551.1SpgoyetteESC M
561.2Swiz     Reverse Index (RI  is 0x8d).
571.1SpgoyetteESC N
581.1Spgoyette     Single Shift Select of G2 Character Set (SS2  is 0x8e).  This
591.1Spgoyette     affects next character only.
601.1SpgoyetteESC O
611.2Swiz     Single Shift Select of G3 Character Set (SS3  is 0x8f).  This
621.2Swiz     affects next character only.
631.1SpgoyetteESC P
641.1Spgoyette     Device Control String (DCS  is 0x90).
651.1SpgoyetteESC V
661.1Spgoyette     Start of Guarded Area (SPA  is 0x96).
671.1SpgoyetteESC W
681.1Spgoyette     End of Guarded Area (EPA  is 0x97).
691.1SpgoyetteESC X
701.1Spgoyette     Start of String (SOS  is 0x98).
711.1SpgoyetteESC Z
721.1Spgoyette     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 10 colors (below) which may be set or queried using 1 0
883          through 1 9  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 zero or more characters from the
935          set c  p  s  0  1  2  3  4  5  6  7 .  It is used to construct
936          a list of selection parameters for clipboard, primary, select,
937          or cut buffers 0 through 7 respectively, in the order given.
938          If the parameter is empty, xterm uses s 0 , to specify the
939          configurable 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          If the second parameter is neither a base64 string nor ? ,
947          then the selection is cleared.
948
949            Ps = 1 0 4  ; c -> Reset Color Number c.  It is reset to the
950          color specified by the corresponding X resource.  Any number
951          of c parameters may be given.  These parameters correspond to
952          the ANSI colors 0-7, their bright versions 8-15, and if sup-
953          ported, the remainder of the 88-color or 256-color table.  If
954          no parameters are given, the entire table will be reset.
955
956            Ps = 1 0 5  ; c -> Reset Special Color Number c.  It is
957          reset to the color specified by the corresponding X resource.
958          Any number of c parameters may be given.  These parameters
959          correspond to the special colors which can be set using an OSC
960          5  control (or by adding the maximum number of colors using an
961          OSC 4  control).
962
963          The dynamic colors can also be reset to their default
964          (resource) values:
965            Ps = 1 1 0  -> Reset VT100 text foreground color.
966            Ps = 1 1 1  -> Reset VT100 text background color.
967            Ps = 1 1 2  -> Reset text cursor color.
968            Ps = 1 1 3  -> Reset mouse foreground color.
969            Ps = 1 1 4  -> Reset mouse background color.
970            Ps = 1 1 5  -> Reset Tektronix foreground color.
971            Ps = 1 1 6  -> Reset Tektronix background color.
972            Ps = 1 1 7  -> Reset highlight color.
973            Ps = 1 1 8  -> Reset Tektronix cursor color.
974
975Privacy Message
976PM Pt ST  xterm implements no PM  functions; Pt is ignored.  Pt need not
977          be printable characters.
978
979Alt and Meta Keys
980Many keyboards have keys labeled "Alt".  Few have keys labeled "Meta".
981However, xterm's default translations use the Meta modifier.  Common
982keyboard configurations assign the Meta modifier to an "Alt" key.  By
983using xmodmap one may have the modifier assigned to a different key, and
984have "real" alt and meta keys.  Here is an example:
985
986             ! put meta on mod3 to distinguish it from alt
987             keycode 64 = Alt_L
988             clear mod1
989             add mod1 = Alt_L
990             keycode 115 = Meta_L
991             clear mod3
992             add mod3 = Meta_L
993
994
995The metaSendsEscape resource (and altSendsEscape if altIsNotMeta is set)
996can be used to control the way the Meta modifier applies to ordinary
997keys unless the modifyOtherKeys resource is set:
998          - prefix a key with the ESC  character.
999          - shift the key from codes 0-127 to 128-255 by adding 128.
1000
1001The table shows the result for a given character "x" with modifiers
1002according to the default translations with the resources set on or off.
1003This assumes altIsNotMeta is set:
1004
1005       -----------------------------------------------------------
1006       key          altSendsEscape   metaSendsEscape   result
1007       -----------------------------------------------------------
1008       x            off              off               x
1009       Meta-x       off              off               shift
1010       Alt-x        off              off               shift
1011       Alt+Meta-x   off              off               shift
1012       x            ON               off               x
1013       Meta-x       ON               off               shift
1014       Alt-x        ON               off               ESC  x
1015       Alt+Meta-x   ON               off               ESC  shift
1016       x            off              ON                x
1017       Meta-x       off              ON                ESC  x
1018       Alt-x        off              ON                shift
1019       Alt+Meta-x   off              ON                ESC  shift
1020       x            ON               ON                x
1021       Meta-x       ON               ON                ESC  x
1022       Alt-x        ON               ON                ESC  x
1023       Alt+Meta-x   ON               ON                ESC  x
1024       -----------------------------------------------------------
1025
1026
1027PC-Style Function Keys
1028If xterm does minimal translation of the function keys, it usually does
1029this with a PC-style keyboard, so PC-style function keys result.  Sun
1030keyboards are similar to PC keyboards.  Both have cursor and scrolling
1031operations printed on the keypad, which duplicate the smaller cursor and
1032scrolling keypads.
1033
1034X does not predefine NumLock (used for VT220 keyboards) or Alt (used as
1035an extension for the Sun/PC keyboards) as modifiers.  These keys are
1036recognized as modifiers when enabled by the numLock resource, or by the
1037"DECSET 1 0 3 5 " control sequence.
1038
1039The cursor keys transmit the following escape sequences depending on the
1040mode specified via the DECCKM escape sequence.
1041
1042                      Key         Normal    Application
1043                  --------------------------------------
1044                  Cursor Up      CSI A      SS3 A
1045                  Cursor Down    CSI B      SS3 B
1046                  Cursor Right   CSI C      SS3 C
1047                  Cursor Left    CSI D      SS3 D
1048                  --------------------------------------
1049
1050The home- and end-keys (unlike PageUp and other keys also on the 6-key
1051editing keypad) are considered "cursor keys" by xterm.  Their mode is
1052also controlled by the DECCKM escape sequence:
1053
1054                      Key       Normal    Application
1055                    ----------------------------------
1056                    Home       CSI H      SS3 H
1057                    End        CSI F      SS3 F
1058                    ----------------------------------
1059
1060
1061The application keypad transmits the following escape sequences depend-
1062ing on the mode specified via the DECPNM and DECPAM escape sequences.
1063Use the NumLock key to override the application mode.
1064
1065Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are
1066supported by the program.
1067
1068           Key         Numeric    Application   Terminfo   Termcap
1069      --------------------------------------------------------------
1070      Space            SP         SS3 SP        -          -
1071      Tab              TAB        SS3 I         -          -
1072      Enter            CR         SS3 M         kent       @8
1073      PF1              SS3 P      SS3 P         kf1        k1
1074      PF2              SS3 Q      SS3 Q         kf2        k2
1075      PF3              SS3 R      SS3 R         kf3        k3
1076      PF4              SS3 S      SS3 S         kf4        k4
1077      * (multiply)     *          SS3 j         -          -
1078      + (add)          +          SS3 k         -          -
1079      , (comma)        ,          SS3 l         -          -
1080      - (minus)        -          SS3 m         -          -
1081      . (Delete)       .          CSI 3 ~       -          -
1082      / (divide)       /          SS3 o         -          -
1083      0 (Insert)       0          CSI 2 ~       -          -
1084      1 (End)          1          SS3 F         kc1        K4
1085      2 (DownArrow)    2          CSI B         -          -
1086      3 (PageDown)     3          CSI 6 ~       kc3        K5
1087      4 (LeftArrow)    4          CSI D         -          -
1088      5 (Begin)        5          CSI E         kb2        K2
1089      6 (RightArrow)   6          CSI C         -          -
1090      7 (Home)         7          SS3 H         ka1        K1
1091      8 (UpArrow)      8          CSI A         -          -
1092      9 (PageUp)       9          CSI 5 ~       ka3        K3
1093      = (equal)        =          SS3 X         -          -
1094      --------------------------------------------------------------
1095
1096They also provide 12 function keys, as well as a few other special-pur-
1097pose keys:
1098
1099                         Key      Escape Sequence
1100                       ---------------------------
1101                       F1         SS3 P
1102                       F2         SS3 Q
1103                       F3         SS3 R
1104                       F4         SS3 S
1105                       F5         CSI 1 5 ~
1106                       F6         CSI 1 7 ~
1107                       F7         CSI 1 8 ~
1108                       F8         CSI 1 9 ~
1109                       F9         CSI 2 0 ~
1110                       F10        CSI 2 1 ~
1111                       F11        CSI 2 3 ~
1112                       F12        CSI 2 4 ~
1113                       ---------------------------
1114
1115
1116Older versions of xterm implement different escape sequences for F1
1117through F4.  These can be activated by setting the oldXtermFKeys
1118resource.  However, since they do not correspond to any hardware termi-
1119nal, they have been deprecated.  (The DEC VT220 reserves F1 through F5
1120for local functions such as Setup).
1121
1122                         Key      Escape Sequence
1123                       ---------------------------
1124                       F1         CSI 1 1 ~
1125                       F2         CSI 1 2 ~
1126                       F3         CSI 1 3 ~
1127                       F4         CSI 1 4 ~
1128                       ---------------------------
1129
1130In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is
1131false, xterm recognizes function key modifiers which are parameters
1132appended before the final character of the control sequence.
1133
1134                      Code     Modifiers
1135                    ---------------------------------
1136                       2       Shift
1137                       3       Alt
1138                       4       Shift + Alt
1139                       5       Control
1140                       6       Shift + Control
1141                       7       Alt + Control
1142                       8       Shift + Alt + Control
1143                    ---------------------------------
1144
1145For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
1146
1147If the alwaysUseMods resource is set, the Meta modifier also is recog-
1148nized, making parameters 9 through 16.
1149
1150VT220-Style Function Keys
1151However, xterm is most useful as a DEC VT102 or VT220 emulator.  Set the
1152sunKeyboard resource to true to force a Sun/PC keyboard to act like a
1153VT220 keyboard.
1154
1155The VT102/VT220 application keypad transmits unique escape sequences in
1156application mode, which are distinct from the cursor and scrolling key-
1157pad:
1158
1159                      Key        Numeric    Application
1160                  --------------------------------------
1161                  Space          SP         SS3 SP
1162                  Tab            TAB        SS3 I
1163                  Enter          CR         SS3 M
1164                  PF1            SS3 P      SS3 P
1165                  PF2            SS3 Q      SS3 Q
1166                  PF3            SS3 R      SS3 R
1167                  PF4            SS3 S      SS3 S
1168                  * (multiply)   *          SS3 j
1169                  + (add)        +          SS3 k
1170                  , (comma)      ,          SS3 l
1171                  - (minus)      -          SS3 m
1172                  . (period)     .          SS3 n
1173                  / (divide)     /          SS3 o
1174                  0              0          SS3 p
1175                  1              1          SS3 q
1176                  2              2          SS3 r
1177                  3              3          SS3 s
1178                  4              4          SS3 t
1179                  5              5          SS3 u
1180                  6              6          SS3 v
1181                  7              7          SS3 w
1182                  8              8          SS3 x
1183                  9              9          SS3 y
1184                  = (equal)      =          SS3 X
1185                  --------------------------------------
1186
1187The VT220 provides a 6-key editing keypad, which is analogous to that on
1188the PC keyboard.  It is not affected by DECCKM or DECPNM/DECPAM:
1189
1190                     Key       Normal    Application
1191                   ----------------------------------
1192                   Insert     CSI 2 ~    CSI 2 ~
1193                   Delete     CSI 3 ~    CSI 3 ~
1194                   Home       CSI 1 ~    CSI 1 ~
1195                   End        CSI 4 ~    CSI 4 ~
1196                   PageUp     CSI 5 ~    CSI 5 ~
1197                   PageDown   CSI 6 ~    CSI 6 ~
1198                   ----------------------------------
1199
1200The VT220 provides 8 additional function keys.  With a Sun/PC keyboard,
1201access these keys by Control/F1 for F13, etc.
1202
1203                         Key      Escape Sequence
1204                       ---------------------------
1205                       F13        CSI 2 5 ~
1206                       F14        CSI 2 6 ~
1207                       F15        CSI 2 8 ~
1208                       F16        CSI 2 9 ~
1209                       F17        CSI 3 1 ~
1210                       F18        CSI 3 2 ~
1211                       F19        CSI 3 3 ~
1212                       F20        CSI 3 4 ~
1213                       ---------------------------
1214
1215
1216VT52-Style Function Keys
1217A VT52 does not have function keys, but it does have a numeric keypad
1218and cursor keys.  They differ from the other emulations by the prefix.
1219Also, the cursor keys do not change:
1220
1221                       Key        Normal/Application
1222                   ----------------------------------
1223                   Cursor Up      ESC A
1224                   Cursor Down    ESC B
1225                   Cursor Right   ESC C
1226                   Cursor Left    ESC D
1227                   ----------------------------------
1228
1229The keypad is similar:
1230
1231                      Key        Numeric    Application
1232                  --------------------------------------
1233                  Space          SP         ESC ? SP
1234                  Tab            TAB        ESC ? I
1235                  Enter          CR         ESC ? M
1236                  PF1            ESC P      ESC P
1237                  PF2            ESC Q      ESC Q
1238                  PF3            ESC R      ESC R
1239                  PF4            ESC S      ESC S
1240                  * (multiply)   *          ESC ? j
1241                  + (add)        +          ESC ? k
1242                  , (comma)      ,          ESC ? l
1243                  - (minus)      -          ESC ? m
1244                  . (period)     .          ESC ? n
1245                  / (divide)     /          ESC ? o
1246                  0              0          ESC ? p
1247                  1              1          ESC ? q
1248                  2              2          ESC ? r
1249                  3              3          ESC ? s
1250                  4              4          ESC ? t
1251                  5              5          ESC ? u
1252                  6              6          ESC ? v
1253                  7              7          ESC ? w
1254                  8              8          ESC ? x
1255                  9              9          ESC ? y
1256                  = (equal)      =          ESC ? X
1257                  --------------------------------------
1258
1259
1260Sun-Style Function Keys
1261The xterm program provides support for Sun keyboards more directly, by a
1262menu toggle that causes it to send Sun-style function key codes rather
1263than VT220.  Note, however, that the sun and VT100 emulations are not
1264really compatible.  For example, their wrap-margin behavior differs.
1265
1266Only function keys are altered; keypad and cursor keys are the same.
1267The emulation responds identically.  See the xterm-sun terminfo entry
1268for details.
1269
1270HP-Style Function Keys
1271Similarly, xterm can be compiled to support HP keyboards.  See the
1272xterm-hp terminfo entry for details.
1273
1274The Alternate Screen Buffer
1275Xterm maintains two screen buffers.  The normal screen buffer allows you
1276to scroll back to view saved lines of output up to the maximum set by
1277the saveLines resource.  The alternate screen buffer is exactly as large
1278as the display, contains no additional saved lines.  When the alternate
1279screen buffer is active, you cannot scroll back to view saved lines.
1280Xterm provides control sequences and menu entries for switching between
1281the two.
1282
1283Most full-screen applications use terminfo or termcap to obtain strings
1284used to start/stop full-screen mode, i.e., smcup and rmcup for terminfo,
1285or the corresponding ti and te for termcap.  The titeInhibit resource
1286removes the ti and te strings from the TERMCAP string which is set in
1287the environment for some platforms.  That is not done when xterm is
1288built with terminfo libraries because terminfo does not provide the
1289whole text of the termcap data in one piece.  It would not work for ter-
1290minfo anyway, since terminfo data is not passed in environment vari-
1291ables; setting an environment variable in this manner would have no
1292effect on the application's ability to switch between normal and alter-
1293nate screen buffers.  Instead, the newer private mode controls (such as
12941 0 4 9 ) for switching between normal and alternate screen buffers sim-
1295ply disable the switching.  They add other features such as clearing the
1296display for the same reason: to make the details of switching indepen-
1297dent of the application that requests the switch.
1298
1299Bracketed Paste Mode
1300When bracketed paste mode is set, pasted text is bracketed with control
1301sequences so that the program can differentiate pasted text from typed-
1302in text.  When bracketed paste mode is set, the program will receive:
1303   ESC [ 200 ~,
1304followed by the pasted text, followed by
1305   ESC [ 201 ~.
1306
1307Title Modes
1308The window- and icon-labels can be set or queried using control
1309sequences.  As a VT220-emulator, xterm "should" limit the character
1310encoding for the corresponding strings to ISO-8859-1.  Indeed, it used
1311to be the case (and was documented) that window titles had to be
1312ISO-8859-1.  This is no longer the case.  However, there are many appli-
1313cations which still assume that titles are set using ISO-8859-1.  So
1314that is the default behavior.
1315
1316If xterm is running with UTF-8 encoding, it is possible to use window-
1317and icon-labels encoded using UTF-8.  That is because the underlying X
1318libraries (and many, but not all) window managers support this feature.
1319
1320The utf8Title X resource setting tells xterm to disable a reconversion
1321of the title string back to ISO-8859-1, allowing the title strings to be
1322interpreted as UTF-8.  The same feature can be enabled using the title
1323mode control sequence described in this summary.
1324
1325Separate from the ability to set the titles, xterm provides the ability
1326to query the titles, returning them either in ISO-8859-1 or UTF-8.  This
1327choice is available only while xterm is using UTF-8 encoding.
1328
1329Finally, the characters sent to, or returned by a title control are less
1330constrained than the rest of the control sequences.  To make them more
1331manageable (and constrained), for use in shell scripts, xterm has an
1332optional feature which decodes the string from hexadecimal (for setting
1333titles) or for encoding the title into hexadecimal when querying the
1334value.
1335
1336Mouse Tracking
1337The VT widget can be set to send the mouse position and other informa-
1338tion on button presses.  These modes are typically used by editors and
1339other full-screen applications that want to make use of the mouse.
1340
1341There are six mutually exclusive modes.  One is DEC Locator mode,
1342enabled by the DECELR CSI Ps ; Ps  '  z control sequence, and is not
1343described here (control sequences are summarized above).  The remaining
1344five modes are each enabled (or disabled) by a different parameter in
1345the "DECSET CSI ? Pm h " or "DECRST CSI ? Pm l " control sequence.
1346
1347Manifest constants for the parameter values are defined in xcharmouse.h
1348as follows:
1349
1350                #define SET_X10_MOUSE               9
1351                #define SET_VT200_MOUSE             1000
1352                #define SET_VT200_HIGHLIGHT_MOUSE   1001
1353                #define SET_BTN_EVENT_MOUSE         1002
1354                #define SET_ANY_EVENT_MOUSE         1003
1355
1356                #define SET_FOCUS_EVENT_MOUSE       1004
1357
1358                #define SET_EXT_MODE_MOUSE          1005
1359
1360The motion reporting modes are strictly xterm extensions, and are not
1361part of any standard, though they are analogous to the DEC VT200 DECELR
1362locator reports.
1363
1364Parameters (such as pointer position and button number) for all mouse
1365tracking escape sequences generated by xterm encode numeric parameters
1366in a single character as value+32.  For example, !  specifies the value
13671.  The upper left character position on the terminal is denoted as 1,1.
1368
1369X10 compatibility mode sends an escape sequence only on button press,
1370encoding the location and the mouse button pressed.  It is enabled by
1371specifying parameter 9 to DECSET.  On button press, xterm sends CSI M
1372CbCxCy (6 characters).
1373o   Cb is button-1.
1374o   Cx and Cy are the x and y coordinates of the mouse when the button
1375    was pressed.
1376
1377Normal tracking mode sends an escape sequence on both button press and
1378release.  Modifier key (shift, ctrl, meta) information is also sent.  It
1379is enabled by specifying parameter 1000 to DECSET.  On button press or
1380release, xterm sends CSI M CbCxCy.
1381o   The low two bits of Cb encode button information: 0=MB1 pressed,
1382    1=MB2 pressed, 2=MB3 pressed, 3=release.
1383o   The next three bits encode the modifiers which were down when the
1384    button was pressed and are added together:  4=Shift, 8=Meta, 16=Con-
1385    trol.  Note however that the shift and control bits are normally
1386    unavailable because xterm uses the control modifier with mouse for
1387    popup menus, and the shift modifier is used in the default transla-
1388    tions for button events.  The Meta modifier recognized by xterm is
1389    the mod1 mask, and is not necessarily the "Meta" key (see xmodmap).
1390o   Cx and Cy are the x and y coordinates of the mouse event, encoded as
1391    in X10 mode.
1392
1393Wheel mice may return buttons 4 and 5.  Those buttons are represented by
1394the same event codes as buttons 1 and 2 respectively, except that 64 is
1395added to the event code.  Release events for the wheel buttons are not
1396reported.
1397
1398Mouse highlight tracking notifies a program of a button press, receives
1399a range of lines from the program, highlights the region covered by the
1400mouse within that range until button release, and then sends the program
1401the release coordinates.  It is enabled by specifying parameter 1001 to
1402DECSET.  Highlighting is performed only for button 1, though other but-
1403ton events can be received.
1404
1405Warning: use of this mode requires a cooperating program or it will hang
1406xterm.
1407
1408On button press, the same information as for normal tracking is gener-
1409ated; xterm then waits for the program to send mouse tracking informa-
1410tion.  All X events are ignored until the proper escape sequence is
1411received from the pty: CSI Ps ; Ps ; Ps ; Ps ; Ps T .  The parameters
1412are func, startx, starty, firstrow, and lastrow.  func is non-zero to
1413initiate highlight tracking and zero to abort.  startx and starty give
1414the starting x and y location for the highlighted region.  The ending
1415location tracks the mouse, but will never be above row firstrow and will
1416always be above row lastrow.  (The top of the screen is row 1.)  When
1417the button is released, xterm reports the ending position one of two
1418ways:
1419o   if the start and end coordinates are the same locations:
1420    CSI t CxCy.
1421o   otherwise:
1422    CSI T CxCyCxCyCxCy.
1423    The parameters are startx, starty, endx, endy, mousex, and mousey.
1424    -    startx, starty, endx, and endy give the starting and ending
1425         character positions of the region.
1426    -    mousex and mousey give the location of the mouse at button up,
1427         which may not be over a character.
1428
1429Button-event tracking is essentially the same as normal tracking, but
1430xterm also reports button-motion events.  Motion events are reported
1431only if the mouse pointer has moved to a different character cell.  It
1432is enabled by specifying parameter 1002 to DECSET.  On button press or
1433release, xterm sends the same codes used by normal tracking mode.
1434o   On button-motion events, xterm adds 32 to the event code (the third
1435    character, Cb).
1436o   The other bits of the event code specify button and modifier keys as
1437    in normal mode.  For example, motion into cell x,y with button 1
1438    down is reported as CSI M @ CxCy.  ( @  = 32 + 0 (button 1) + 32
1439    (motion indicator) ).  Similarly, motion with button 3 down is
1440    reported as CSI M B CxCy.  ( B  = 32 + 2 (button 3) + 32 (motion
1441    indicator) ).
1442
1443Any-event mode is the same as button-event mode, except that all motion
1444events are reported, even if no mouse button is down.  It is enabled by
1445specifying 1003 to DECSET.
1446
1447FocusIn/FocusOut can be combined with any of the mouse events since it
1448uses a different protocol.  When set, it causes xterm to send CSI I
1449when the terminal gains focus, and CSI O  when it loses focus.
1450
1451Extended mouse mode enables UTF-8 encoding for Cx and Cy under all
1452tracking modes, expanding the maximum encodable position from 223 to
14532015.  For positions less than 95, the resulting output is identical
1454under both modes.  Under extended mouse mode, positions greater than 95
1455generate "extra" bytes which will confuse applications which do not
1456treat their input as a UTF-8 stream.  Likewise, Cb will be UTF-8
1457encoded, to reduce confusion with wheel mouse events.
1458
1459NOTE: Under normal mouse mode, positions outside (160,94) result in byte
1460pairs which can be interpreted as a single UTF-8 character; applications
1461which do treat their input as UTF-8 will almost certainly be confused
1462unless extended mouse mode is active.
1463
1464Tektronix 4014 Mode
1465Most of these sequences are standard Tektronix 4014 control sequences.
1466Graph mode supports the 12-bit addressing of the Tektronix 4014.  The
1467major features missing are the write-through and defocused modes.  This
1468document does not describe the commands used in the various Tektronix
1469plotting modes but does describe the commands to switch modes.
1470
1471BEL       Bell (Ctrl-G).
1472BS        Backspace (Ctrl-H).
1473TAB       Horizontal Tab (Ctrl-I).
1474LF        Line Feed or New Line (Ctrl-J).
1475VT        Cursor up (Ctrl-K).
1476FF        Form Feed or New Page (Ctrl-L).
1477CR        Carriage Return (Ctrl-M).
1478ESC ETX   Switch to VT100 Mode (ESC Ctrl-C).
1479ESC ENQ   Return Terminal Status (ESC Ctrl-E).
1480ESC FF    PAGE (Clear Screen) (ESC Ctrl-L).
1481ESC SO    Begin 4015 APL mode (ESC Ctrl-N).  (This is ignored by xterm).
1482ESC SI    End 4015 APL mode (ESC Ctrl-O).  (This is ignored by xterm).
1483ESC ETB   COPY (Save Tektronix Codes to file COPYyyyy-mm-dd.hh:mm:ss).
1484            ETB  (end transmission block) is the same as Ctrl-W.
1485ESC CAN   Bypass Condition (ESC Ctrl-X).
1486ESC SUB   GIN mode (ESC Ctrl-Z).
1487ESC FS    Special Point Plot Mode (ESC Ctrl-\).
1488ESC 8     Select Large Character Set.
1489ESC 9     Select #2 Character Set.
1490ESC :     Select #3 Character Set.
1491ESC ;     Select Small Character Set.
1492OSC Ps ; Pt BEL
1493          Set Text Parameters of VT window.
1494            Ps = 0  -> Change Icon Name and Window Title to Pt.
1495            Ps = 1  -> Change Icon Name to Pt.
1496            Ps = 2  -> Change Window Title to Pt.
1497            Ps = 4 6  -> Change Log File to Pt.  (This is normally dis-
1498          abled by a compile-time option).
1499ESC `     Normal Z Axis and Normal (solid) Vectors.
1500ESC a     Normal Z Axis and Dotted Line Vectors.
1501ESC b     Normal Z Axis and Dot-Dashed Vectors.
1502ESC c     Normal Z Axis and Short-Dashed Vectors.
1503ESC d     Normal Z Axis and Long-Dashed Vectors.
1504ESC h     Defocused Z Axis and Normal (solid) Vectors.
1505ESC i     Defocused Z Axis and Dotted Line Vectors.
1506ESC j     Defocused Z Axis and Dot-Dashed Vectors.
1507ESC k     Defocused Z Axis and Short-Dashed Vectors.
1508ESC l     Defocused Z Axis and Long-Dashed Vectors.
1509ESC p     Write-Thru Mode and Normal (solid) Vectors.
1510ESC q     Write-Thru Mode and Dotted Line Vectors.
1511ESC r     Write-Thru Mode and Dot-Dashed Vectors.
1512ESC s     Write-Thru Mode and Short-Dashed Vectors.
1513ESC t     Write-Thru Mode and Long-Dashed Vectors.
1514FS        Point Plot Mode (Ctrl-\).
1515GS        Graph Mode (Ctrl-]).
1516RS        Incremental Plot Mode (Ctrl-^).
1517US        Alpha Mode (Ctrl-_).
1518
1519VT52 Mode
1520Parameters for cursor movement are at the end of the ESC Y  escape
1521sequence.  Each ordinate is encoded in a single character as value+32.
1522For example, !  is 1.  The screen coordinate system is 0-based.
1523
1524ESC A     Cursor up.
1525ESC B     Cursor down.
1526ESC C     Cursor right.
1527ESC D     Cursor left.
1528ESC F     Enter graphics mode.
1529ESC G     Exit graphics mode.
1530ESC H     Move the cursor to the home position.
1531ESC I     Reverse line feed.
1532ESC J     Erase from the cursor to the end of the screen.
1533ESC K     Erase from the cursor to the end of the line.
1534ESC Y Ps Ps
1535          Move the cursor to given row and column.
1536ESC Z     Identify.
1537            -> ESC  /  Z  (``I am a VT52.'').
1538ESC =     Enter alternate keypad mode.
1539ESC >     Exit alternate keypad mode.
1540ESC <     Exit VT52 mode (Enter VT100 mode).
1541