home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 45 / cda45.iso / Linux / XFree86-4.0 / doc / ctlseqs.TXT < prev    next >
Encoding:
Text File  |  2000-03-09  |  41.2 KB  |  1,039 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.             Xterm Control Sequences
  11.  
  12.                    Edward Moy
  13.            University of California, Berkeley
  14.  
  15.                    Revised by
  16.  
  17.                  Stephen Gildea
  18.               X Consortium (1994)
  19.  
  20.                  Thomas Dickey
  21.               XFree86 Project (1996-1999)
  22.  
  23.  
  24.  
  25. Definitions
  26.  
  27. c    The literal character c.
  28.  
  29. C    A single (required) character.
  30.  
  31. Ps   A single (usually optional) numeric parameter, composed of one of
  32.      more digits.
  33.  
  34. Pm   A multiple numeric parameter composed of any number of single
  35.      numeric parameters, separated by ;  character(s).    Individual val-
  36.      ues for the parameters are listed with Ps .
  37.  
  38. Pt   A text parameter composed of printable characters.
  39.  
  40. C1 (8-Bit) Control Characters
  41.  
  42. The xterm program recognizes both 8-bit and 7-bit control characters.
  43. It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
  44. The following pairs of 7-bit and 8-bit control characters are equiva-
  45. lent:
  46.  
  47. ESC D
  48.      Index (IND: 0x84)
  49. ESC E
  50.      Next Line (NEL: 0x85)
  51. ESC H
  52.      Tab Set (HTS: 0x88)
  53. ESC M
  54.      Reverse Index (RI: 0x8d)
  55. ESC N
  56.      Single Shift Select of G2 Character Set (SS2: 0x8e): affects next
  57.      character only
  58. ESC O
  59.      Single Shift Select of G3 Character Set (SS3: 0x8f): affects next
  60.      character only
  61. ESC P
  62.      Device Control String (DCS: 0x90)
  63. ESC V
  64.      Start of Guarded Area (SPA: 0x96)
  65. ESC W
  66.      End of Guarded Area (EPA: 0x97)
  67. ESC X
  68.      Start of String (SOS: 0x98)
  69. ESC Z
  70.      Return Terminal ID (DECID: 0x9a).    Obsolete form of CSI c    (DA).
  71. ESC [
  72.      Control Sequence Introducer (CSI: 0x9b)
  73. ESC \
  74.      String Terminator (ST: 0x9c)
  75. ESC ]
  76.      Operating System Command (OSC: 0x9d)
  77. ESC ^
  78.      Privacy Message (PM: 0x9e)
  79. ESC _
  80.      Application Program Command (APC: 0x9f)
  81.  
  82. These control characters are used in the vtXXX emulation.
  83.  
  84. VT100 Mode
  85. Most of these control sequences are standard VT102 control sequences,
  86. but there is support for later DEC VT terminals (i.e., VT220 and VT320),
  87. as well as ISO 6429 and aixterm color controls.  VT102 features not sup-
  88. ported are auto-repeat and blinking characters.  There are additional
  89. control sequences to provide xterm-dependent functions, such as the
  90. scrollbar or window size.  Where the function is specified by DEC or ISO
  91. 6429, the code assigned to it is given in parentheses.    The escape codes
  92. to designate and invoke character sets are specified by ISO 2022; see
  93. that document for a discussion of character sets.
  94.  
  95. Single-character functions
  96. BEL           Bell (Ctrl-G)
  97. BS           Backspace (Ctrl-H)
  98. CR           Carriage Return (Ctrl-M)
  99. ENQ           Return Terminal Status (Ctrl-E).  Default response is the
  100.            terminal name, e.g., "xterm", but may be overridden by a
  101.            resource answerbackString.
  102. FF           Form Feed or New Page (NP) (Ctrl-L) same as LF
  103. LF           Line Feed or New Line (NL) (Ctrl-J)
  104. SO           Shift Out (Ctrl-N) -> Switch to Alternate Character Set:
  105.            invokes the G1 character set.
  106. SP           Space.
  107. TAB           Horizontal Tab (HT) (Ctrl-I)
  108. VT           Vertical Tab (Ctrl-K) same as LF
  109. SI           Shift In (Ctrl-O) -> Switch to Standard Character Set:
  110.            invokes the G0 character set (the default).
  111.  
  112. Controls beginning with ESC (other than those where ESC is part of a
  113. 7-bit equivalent to 8-bit C1 controls), ordered by the final charac-
  114. ter(s).
  115. ESC SP F       7-bit controls (S7C1T).
  116. ESC SP G       8-bit controls (S8C1T).
  117. ESC SP L       Set ANSI conformance level 1 (vt100, 7-bit controls).
  118. ESC SP M       Set ANSI conformance level 2 (vt200).
  119. ESC SP N       Set ANSI conformance level 3 (vt300).
  120. ESC # 3        DEC double-height line, top half (DECDHL)
  121. ESC # 4        DEC double-height line, bottom half (DECDHL)
  122. ESC # 5        DEC single-width line (DECSWL)
  123. ESC # 6        DEC double-width line (DECDWL)
  124. ESC # 8        DEC Screen Alignment Test (DECALN)
  125. ESC % @        Select default character set, ISO 8859-1 (ISO 2022)
  126. ESC % G        Select UTF-8 character set (ISO 2022)
  127. ESC ( C        Designate G0 Character Set (ISO 2022)
  128. ESC ) C        Designate G1 Character Set (ISO 2022)
  129. ESC * C        Designate G2 Character Set (ISO 2022)
  130. ESC + C        Designate G3 Character Set (ISO 2022)
  131.            Final character C for designating character sets (0 , A
  132.            and B  apply to VT100 and up, the remainder to VT220 and
  133.            up):
  134.          C = 0    -> DEC Special Character and Line Drawing Set
  135.          C = A    -> United Kingdom (UK)
  136.          C = B    -> United States (USASCII)
  137.          C = 4    -> Dutch
  138.          C = C    or 5  -> Finnish
  139.          C = R    -> French
  140.          C = Q    -> French Canadian
  141.          C = K    -> German
  142.          C = Y    -> Italian
  143.          C = E    or 6  -> Norwegian/Danish
  144.          C = Z    -> Spanish
  145.          C = H    or 7  -> Swedish
  146.          C = =    -> Swiss
  147. ESC 7           Save Cursor (DECSC)
  148. ESC 8           Restore Cursor (DECRC)
  149. ESC =           Application Keypad (DECPAM)
  150. ESC >           Normal Keypad (DECPNM)
  151. ESC F           Cursor to lower left corner of screen (if enabled by the
  152.            hpLowerleftBugCompat resource).
  153. ESC c           Full Reset (RIS)
  154. ESC l           Memory Lock (per HP terminals).    Locks memory above the
  155.            cursor.
  156. ESC m           Memory Unlock (per HP terminals)
  157. ESC n           Invoke the G2 Character Set (LS2)
  158. ESC o           Invoke the G3 Character Set (LS3)
  159. ESC |           Invoke the G3 Character Set as GR (LS3R).  Has no visible
  160.            effect in xterm.
  161. ESC }           Invoke the G2 Character Set as GR (LS2R).  Has no visible
  162.            effect in xterm.
  163. ESC ~           Invoke the G1 Character Set as GR (LS1R).  Has no visible
  164.            effect in xterm.
  165.  
  166. Application Program-Control functions
  167. APC Pt ST      xterm implements no APC functions; Pt is ignored.  Pt
  168.            need not be printable characters.
  169.  
  170. Device-Control functions
  171. DCS Ps; Ps| Pt ST
  172.            User-Defined Keys (DECUDK).  The first parameter:
  173.          Ps = 0  -> Clear all UDK definitions before starting
  174.            (default)
  175.          Ps = 1  -> Erase Below (default)
  176.            The second parameter:
  177.          Ps = 0  -> Lock the keys (default)
  178.          Ps = 1  -> Do not lock.
  179.            The third parameter is a ';'-separated list of strings
  180.            denoting the key-code separated by a '/' from the hex-
  181.            encoded key value.  The key codes correspond to the DEC
  182.            function-key codes (e.g., F6=17).
  183. DCS $ q Pt ST  Request Status String (DECRQSS).  The string following
  184.            the "q" is one of the following:
  185.          " q     -> DECSCA
  186.          " p     -> DECSCL
  187.          r     -> DECSTBM
  188.          m     -> SGR
  189.            xterm responds with DCS 1 $ r Pt ST for valid requests,
  190.            replacing the Pt with the corresponding CSI string, or
  191.            DCS 0 $ r Pt ST for invalid requests.
  192.  
  193. Functions using CSI, ordered by the final character(s)
  194. CSI Ps @       Insert Ps (Blank) Character(s) (default = 1) (ICH)
  195. CSI Ps A       Cursor Up Ps Times (default = 1) (CUU)
  196. CSI Ps B       Cursor Down Ps Times (default = 1) (CUD)
  197. CSI Ps C       Cursor Forward Ps Times (default = 1) (CUF)
  198. CSI Ps D       Cursor Backward Ps Times (default = 1) (CUB)
  199. CSI Ps E       Cursor Next Line Ps Times (default = 1) (CNL)
  200. CSI Ps F       Cursor Preceding Line Ps Times (default = 1) (CPL)
  201. CSI Ps G       Cursor Character Absolute  [column] (default = [row,1])
  202.            (CHA)
  203. CSI Ps ; Ps H  Cursor Position [row;column] (default = [1,1]) (CUP)
  204. CSI Ps I       Cursor Forward Tabulation Ps tab stops (default = 1)
  205.            (CHT)
  206. CSI Ps J       Erase in Display (ED)
  207.          Ps = 0  -> Erase Below (default)
  208.          Ps = 1  -> Erase Above
  209.          Ps = 2  -> Erase All
  210.          Ps = 3  -> Erase Saved Lines (xterm)
  211. CSI ? Ps J     Erase in Display (DECSED)
  212.          Ps = 0  -> Selective Erase Below (default)
  213.          Ps = 1  -> Selective Erase Above
  214.          Ps = 2  -> Selective Erase All
  215. CSI Ps K       Erase in Line (EL)
  216.          Ps = 0  -> Erase to Right (default)
  217.          Ps = 1  -> Erase to Left
  218.          Ps = 2  -> Erase All
  219. CSI ? Ps K     Erase in Line (DECSEL)
  220.          Ps = 0  -> Selective Erase to Right (default)
  221.          Ps = 1  -> Selective Erase to Left
  222.          Ps = 2  -> Selective Erase All
  223. CSI Ps L       Insert Ps Line(s) (default = 1) (IL)
  224. CSI Ps M       Delete Ps Line(s) (default = 1) (DL)
  225. CSI Ps P       Delete Ps Character(s) (default = 1) (DCH)
  226. CSI Ps S       Scroll up Ps lines (default = 1) (SU)
  227. CSI Ps T       Scroll down Ps lines (default = 1) (SD)
  228. CSI Ps ; Ps ; Ps ; Ps ; Ps T
  229.            Initiate hilite mouse tracking.    Parameters are
  230.            [func;startx;starty;firstrow;lastrow].  See the section
  231.            Mouse Tracking.
  232. CSI Ps X       Erase Ps Character(s) (default = 1) (ECH)
  233. CSI Ps Z       Cursor Backward Tabulation Ps tab stops (default = 1)
  234.            (CBT)
  235. CSI Pm `       Character Position Absolute  [column] (default = [row,1])
  236.            (HPA)
  237. CSI Ps b       Repeat the preceding graphic character Ps times (REP)
  238. CSI Ps c       Send Device Attributes (Primary DA)
  239.          Ps = 0 , 1 or omitted -> request attributes from termi-
  240.            nal.  The response depends on the decTerminalId resource
  241.            setting.
  242.          -> CSI ? 1 ; 2 c  (``VT100 with Advanced Video
  243.            Option'')
  244.          -> CSI ? 1 ; 0 c  (``VT101 with No Options'')
  245.          -> CSI ? 6 c  (``VT102'')
  246.          -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c  (``VT220'')
  247.            The VT100-style response parameters do not mean anything
  248.            by themselves.  VT220 parameters do, telling the host
  249.            what features the terminal supports:
  250.          -> 1  132-columns
  251.          -> 2  Printer
  252.          -> 6  Selective erase
  253.          -> 8  User-defined keys
  254.          -> 9  National replacement character sets
  255.          -> 1 5  Technical characters
  256. CSI > Ps c     Send Device Attributes (Secondary DA)
  257.          Ps = 0 , 1 or omitted -> request the terminal's identi-
  258.            fication code.  The response depends on the decTerminalId
  259.            resource setting.  It should apply only to VT220 and up,
  260.            but xterm extends this to VT100.
  261.          -> CSI Pp ; Pv ; Pc c
  262.            where Pp denotes the terminal type
  263.          -> 0  (``VT100'')
  264.          -> 1  (``VT220'')
  265.            and Pv is the firmware version (for xterm, this is the
  266.            XFree86 patch number, starting with 95).  In a DEC termi-
  267.            nal, Pc indicates the ROM cartridge registration number
  268.            and is always zero.
  269. CSI Pm d       Line Position Absolute  [row] (default = [1,column])
  270.            (VPA)
  271. CSI Ps ; Ps f  Horizontal and Vertical Position [row;column] (default =
  272.            [1,1]) (HVP)
  273. CSI Ps g       Tab Clear (TBC)
  274.          Ps = 0  -> Clear Current Column (default)
  275.          Ps = 3  -> Clear All
  276. CSI Pm h       Set Mode (SM)
  277.          Ps = 2  -> Keyboard Action Mode (AM)
  278.          Ps = 4  -> Insert Mode (IRM)
  279.          Ps = 1 2  -> Send/receive (SRM)
  280.          Ps = 2 0  -> Automatic Newline (LNM)
  281. CSI ? Pm h     DEC Private Mode Set (DECSET)
  282.          Ps = 1  -> Application Cursor Keys (DECCKM)
  283.          Ps = 2  -> Designate USASCII for character sets G0-G3
  284.            (DECANM), and set VT100 mode.
  285.          Ps = 3  -> 132 Column Mode (DECCOLM)
  286.          Ps = 4  -> Smooth (Slow) Scroll (DECSCLM)
  287.          Ps = 5  -> Reverse Video (DECSCNM)
  288.          Ps = 6  -> Origin Mode (DECOM)
  289.          Ps = 7  -> Wraparound Mode (DECAWM)
  290.          Ps = 8  -> Auto-repeat Keys (DECARM)
  291.          Ps = 9  -> Send Mouse X & Y on button press.  See the
  292.            section Mouse Tracking.
  293.          Ps = 1 8  -> Print form feed (DECPFF)
  294.          Ps = 1 9  -> Set print extent to full screen (DECPEX)
  295.          Ps = 2 5  -> Show Cursor (DECTCEM)
  296.          Ps = 3 0  -> Show scrollbar (rxvt).
  297.          Ps = 3 5  -> Enable shifted key-functions (rxvt).
  298.          Ps = 3 8  -> Enter Tektronix Mode (DECTEK)
  299.          Ps = 4 0  -> Allow 80 -> 132 Mode
  300.          Ps = 4 1  -> more(1) fix (see curses resource)
  301.          Ps = 4 2  -> Enable Nation Replacement Character sets
  302.            (DECNRCM)
  303.          Ps = 4 4  -> Turn On Margin Bell
  304.          Ps = 4 5  -> Reverse-wraparound Mode
  305.          Ps = 4 6  -> Start Logging (normally disabled by a com-
  306.            pile-time option)
  307.          Ps = 4 7  -> Use Alternate Screen Buffer (unless dis-
  308.            abled by the titeInhibit resource)
  309.          Ps = 6 6  -> Application keypad (DECNKM)
  310.          Ps = 6 7  -> Backarrow key sends delete (DECBKM)
  311.          Ps = 1 0 0 0  -> Send Mouse X & Y on button press and
  312.            release.  See the section Mouse Tracking.
  313.          Ps = 1 0 0 1  -> Use Hilite Mouse Tracking.
  314.          Ps = 1 0 0 2  -> Use Cell Motion Mouse Tracking.
  315.          Ps = 1 0 0 3  -> Use All Motion Mouse Tracking.
  316.          Ps = 1 0 1 0  -> Scroll to bottom on tty output (rxvt).
  317.          Ps = 1 0 1 1  -> Scroll to bottom on key press (rxvt).
  318.          Ps = 1 0 3 5  -> Enable special modifiers for Alt and
  319.            NumLock keys.
  320.          Ps = 1 0 3 6  -> Send ESC when Meta modifies a key
  321.            (enables the metaSendsEscape resource).
  322.          Ps = 1 0 3 7  -> Send DEL from the editing-keypad
  323.            Delete key
  324.          Ps = 1 0 4 7  -> Use Alternate Screen Buffer (unless
  325.            disabled by the titeInhibit resource)
  326.          Ps = 1 0 4 8  -> Save cursor as in DECSC (unless dis-
  327.            abled by the titeInhibit resource)
  328.          Ps = 1 0 4 9  -> Save cursor as in DECSC and use Alter-
  329.            nate Screen Buffer, clearing it first (unless disabled by
  330.            the titeInhibit resource)
  331.          Ps = 1 0 5 1  -> Set Sun function-key mode.
  332.          Ps = 1 0 5 2  -> Set HP function-key mode.
  333.          Ps = 1 0 6 0  -> Set legacy keyboard emulation (X11R6).
  334.          Ps = 1 0 6 1  -> Set Sun/PC keyboard emulation of VT220
  335.            keyboard.
  336. CSI Pm i       Media Copy (MC)
  337.          Ps = 0  -> Print screen (default)
  338.          Ps = 4  -> Turn off printer controller mode
  339.          Ps = 5  -> Turn on printer controller mode
  340. CSI ? Pm i     Media Copy (MC, DEC-specific)
  341.          Ps = 1  -> Print line containing cursor
  342.          Ps = 4  -> Turn off autoprint mode
  343.          Ps = 5  -> Turn on autoprint mode
  344.          Ps = 1  0  -> Print composed display, ignores DECPEX
  345.          Ps = 1  1  -> Print all pages
  346. CSI Pm l       Reset Mode (RM)
  347.          Ps = 2  -> Keyboard Action Mode (AM)
  348.          Ps = 4  -> Replace Mode (IRM)
  349.          Ps = 1 2  -> Send/receive (SRM)
  350.          Ps = 2 0  -> Normal Linefeed (LNM)
  351. CSI ? Pm l     DEC Private Mode Reset (DECRST)
  352.          Ps = 1  -> Normal Cursor Keys (DECCKM)
  353.          Ps = 2  -> Designate VT52 mode (DECANM).
  354.          Ps = 3  -> 80 Column Mode (DECCOLM)
  355.          Ps = 4  -> Jump (Fast) Scroll (DECSCLM)
  356.          Ps = 5  -> Normal Video (DECSCNM)
  357.          Ps = 6  -> Normal Cursor Mode (DECOM)
  358.          Ps = 7  -> No Wraparound Mode (DECAWM)
  359.          Ps = 8  -> No Auto-repeat Keys (DECARM)
  360.          Ps = 9  -> Don't Send Mouse X & Y on button press
  361.          Ps = 1 8  -> Don't print form feed (DECPFF)
  362.          Ps = 1 9  -> Limit print to scrolling region (DECPEX)
  363.          Ps = 2 5  -> Hide Cursor (DECTCEM)
  364.          Ps = 3 0  -> Don't show scrollbar (rxvt).
  365.          Ps = 3 5  -> Disable shifted key-functions (rxvt).
  366.          Ps = 4 0  -> Disallow 80 -> 132 Mode
  367.          Ps = 4 1  -> No more(1) fix (see curses resource)
  368.          Ps = 4 2  -> Disable Nation Replacement Character sets
  369.            (DECNRCM)
  370.          Ps = 4 4  -> Turn Off Margin Bell
  371.          Ps = 4 5  -> No Reverse-wraparound Mode
  372.          Ps = 4 6  -> Stop Logging (normally disabled by a com-
  373.            pile-time option)
  374.          Ps = 4 7  -> Use Normal Screen Buffer
  375.          Ps = 6 6  -> Numeric keypad (DECNKM)
  376.          Ps = 6 7  -> Backarrow key sends backspace (DECBKM)
  377.          Ps = 1 0 0 0  -> Don't Send Mouse X & Y on button press
  378.            and release.  See the section Mouse Tracking.
  379.          Ps = 1 0 0 1  -> Don't Use Hilite Mouse Tracking
  380.          Ps = 1 0 0 2  -> Don't Use Cell Motion Mouse Tracking
  381.          Ps = 1 0 0 3  -> Don't Use All Motion Mouse Tracking
  382.          Ps = 1 0 1 0  -> Don't scroll to bottom on tty output
  383.            (rxvt).
  384.          Ps = 1 0 1 1  -> Don't scroll to bottom on key press
  385.            (rxvt).
  386.          Ps = 1 0 3 5  -> Disable special modifiers for Alt and
  387.            NumLock keys.
  388.          Ps = 1 0 3 6  -> Don't send ESC when Meta modifies a
  389.            key (disables the metaSendsEscape resource).
  390.          Ps = 1 0 3 7  -> Send VT220 Remove from the editing-
  391.            keypad Delete key
  392.          Ps = 1 0 4 7  -> Use Normal Screen Buffer, clearing
  393.            screen first if in the Alternate Screen (unless disabled
  394.            by the titeInhibit resource)
  395.          Ps = 1 0 4 8  -> Restore cursor as in DECRC (unless
  396.            disabled by the titeInhibit resource)
  397.          Ps = 1 0 4 9  -> Use Normal Screen Buffer and restore
  398.            cursor as in DECRC (unless disabled by the titeInhibit
  399.            resource)
  400.          Ps = 1 0 5 1  -> Reset Sun function-key mode.
  401.          Ps = 1 0 5 2  -> Reset HP function-key mode.
  402.          Ps = 1 0 6 0  -> Reset legacy keyboard emulation
  403.            (X11R6).
  404.          Ps = 1 0 6 1  -> Reset Sun/PC keyboard emulation of
  405.            VT220 keyboard.
  406. CSI Pm m       Character Attributes (SGR)
  407.          Ps = 0  -> Normal (default)
  408.          Ps = 1  -> Bold
  409.          Ps = 4  -> Underlined
  410.          Ps = 5  -> Blink (appears as Bold)
  411.          Ps = 7  -> Inverse
  412.          Ps = 8  -> Invisible (hidden)
  413.          Ps = 2 2  -> Normal (neither bold nor faint)
  414.          Ps = 2 4  -> Not underlined
  415.          Ps = 2 5  -> Steady (not blinking)
  416.          Ps = 2 7  -> Positive (not inverse)
  417.          Ps = 2 8  -> Visible (not hidden)
  418.          Ps = 3 0  -> Set foreground color to Black
  419.          Ps = 3 1  -> Set foreground color to Red
  420.          Ps = 3 2  -> Set foreground color to Green
  421.          Ps = 3 3  -> Set foreground color to Yellow
  422.          Ps = 3 4  -> Set foreground color to Blue
  423.          Ps = 3 5  -> Set foreground color to Magenta
  424.          Ps = 3 6  -> Set foreground color to Cyan
  425.          Ps = 3 7  -> Set foreground color to White
  426.          Ps = 3 9  -> Set foreground color to default (original)
  427.          Ps = 4 0  -> Set background color to Black
  428.          Ps = 4 1  -> Set background color to Red
  429.          Ps = 4 2  -> Set background color to Green
  430.          Ps = 4 3  -> Set background color to Yellow
  431.          Ps = 4 4  -> Set background color to Blue
  432.          Ps = 4 5  -> Set background color to Magenta
  433.          Ps = 4 6  -> Set background color to Cyan
  434.          Ps = 4 7  -> Set background color to White
  435.          Ps = 4 9  -> Set background color to default (origi-
  436.            nal).
  437.  
  438.            If 16-color support is compiled, the following apply.
  439.            Assume that xterm's resources are set so that the ISO
  440.            color codes are the first 8 of a set of 16.  Then the
  441.            aixterm colors are the bright versions of the ISO colors:
  442.          Ps = 9 0  -> Set foreground color to Black
  443.          Ps = 9 1  -> Set foreground color to Red
  444.          Ps = 9 2  -> Set foreground color to Green
  445.          Ps = 9 3  -> Set foreground color to Yellow
  446.          Ps = 9 4  -> Set foreground color to Blue
  447.          Ps = 9 5  -> Set foreground color to Magenta
  448.          Ps = 9 6  -> Set foreground color to Cyan
  449.          Ps = 9 7  -> Set foreground color to White
  450.          Ps = 1 0 0  -> Set background color to Black
  451.          Ps = 1 0 1  -> Set background color to Red
  452.          Ps = 1 0 2  -> Set background color to Green
  453.          Ps = 1 0 3  -> Set background color to Yellow
  454.          Ps = 1 0 4  -> Set background color to Blue
  455.          Ps = 1 0 5  -> Set background color to Magenta
  456.          Ps = 1 0 6  -> Set background color to Cyan
  457.          Ps = 1 0 7  -> Set background color to White
  458.  
  459.            If xterm is compiled with the 16-color support disabled,
  460.            it supports the following, from rxvt:
  461.          Ps = 1 0 0  -> Set foreground and background color to
  462.            default
  463.  
  464.            If 88- or 256-color support is compiled, the following
  465.            apply.
  466.          Ps = 3 8  ; 5    ; Ps -> Set background color to Ps
  467.          Ps = 4 8  ; 5    ; Ps -> Set foreground color to Ps
  468.  
  469. CSI Ps n       Device Status Report (DSR)
  470.          Ps = 5  -> Status Report CSI 0 n  (``OK'')
  471.          Ps = 6  -> Report Cursor Position (CPR) [row;column] as
  472.            CSI r ; c R
  473. CSI ? Ps n     Device Status Report (DSR, DEC-specific)
  474.          Ps = 6  -> Report Cursor Position (CPR) [row;column] as
  475.            CSI ? r ; c R (assumes page is zero).
  476.          Ps = 1 5  -> Report Printer status as CSI ? 1 0  n
  477.            (ready) or CSI ? 1 1  n    (not ready)
  478.          Ps = 2 5  -> Report UDK status as CSI ? 2 0  n
  479.            (unlocked) or CSI ? 2 1    n  (locked)
  480.          Ps = 2 6  -> Report Keyboard status as
  481.            CSI ? 2 7  ;  1    ;  0  ;  0  n  (North American)
  482.            CSI ? 5 3  n  Locator available, if compiled-in, or
  483.            CSI ? 5 0  n  No Locator, if not.
  484. CSI  ! p       Soft terminal reset (DECSTR)
  485. CSI Ps ; Ps " p
  486.            Set conformance level (DECSCL) Valid values for the first
  487.            parameter:
  488.          Ps = 6 1  -> VT100
  489.          Ps = 6 2  -> VT200
  490.          Ps = 6 3  -> VT300 Valid values for the second parame-
  491.            ter:
  492.          Ps = 0  -> 8-bit controls
  493.          Ps = 1  -> 7-bit controls (always set for VT100)
  494.          Ps = 2  -> 8-bit controls
  495. CSI Ps " q     Select character protection attribute (DECSCA).    Valid
  496.            values for the parameter:
  497.          Ps = 0  -> DECSED and DECSEL can erase (default)
  498.          Ps = 1  -> DECSED and DECSEL cannot erase
  499.          Ps = 2  -> DECSED and DECSEL can erase
  500. CSI Ps ; Ps r  Set Scrolling Region [top;bottom] (default = full size of
  501.            window) (DECSTBM)
  502. CSI ? Pm r     Restore DEC Private Mode Values.  The value of Ps previ-
  503.            ously saved is restored.  Ps values are the same as for
  504.            DECSET.
  505. CSI ? Pm s     Save DEC Private Mode Values.  Ps values are the same as
  506.            for DECSET.
  507. CSI Ps ; Ps ; Ps t
  508.            Window manipulation (from dtterm, as well as extensions).
  509.            Valid values for the first (and any additional parame-
  510.            ters) are:
  511.          Ps = 1  -> De-iconify window.
  512.          Ps = 2  -> Iconify window.
  513.          Ps = 3  ; x ; y -> Move window to [x, y].
  514.          Ps = 4  ; height ; width -> Resize the xterm window to
  515.            height and width in pixels.
  516.          Ps = 5  -> Raise the xterm window to the front of the
  517.            stacking order.
  518.          Ps = 6  -> Lower the xterm window to the bottom of the
  519.            stacking order.
  520.          Ps = 7  -> Refresh the xterm window.
  521.          Ps = 8  ; height ; width -> Resize the text area to
  522.            [height;width] in characters.
  523.          Ps = 9  ; 0  -> Restore maximized window.
  524.          Ps = 9  ; 1  -> Maximize window (i.e., resize to screen
  525.            size).
  526.          Ps = 1 1  -> Report xterm window state.  If the xterm
  527.            window is open (non-iconified), it returns CSI 1 t .  If
  528.            the xterm window is iconified, it returns CSI 2 t .
  529.          Ps = 1 3  -> Report xterm window position as CSI 3 ; x;
  530.            yt
  531.          Ps = 1 4  -> Report xterm window in pixels as CSI  4  ;
  532.            height ;  width t
  533.          Ps = 1 8  -> Report the size of the text area in char-
  534.            acters as CSI  8  ;  height ;  width t
  535.          Ps = 1 9  -> Report the size of the screen in charac-
  536.            ters as CSI  9  ;  height ;  width t
  537.          Ps = 2 0  -> Report xterm window's icon label as OSC  L
  538.            label ST
  539.          Ps = 2 1  -> Report xterm window's title as OSC  l
  540.            title ST
  541.          Ps >= 2 4  -> Resize to Ps lines (DECSLPP)
  542. CSI Pt ; Pl ; Pb ; Pr ` w
  543.            Enable Filter Rectangle (DECEFR)
  544.            Parameters are [top;left;bottom;right].
  545.            Defines the coordinates of a filter rectangle and acti-
  546.            vates it.  Anytime the locator is detected outside of the
  547.            filter rectangle, an outside rectangle event is generated
  548.            and the rectangle is disabled.  Filter rectangles are
  549.            always treated as "one-shot" events.  Any parameters that
  550.            are omitted default to the current locator position.  If
  551.            all parameters are omitted, any locator motion will be
  552.            reported.  DECELR always cancels any prevous rectangle
  553.            definition.
  554. CSI Ps x       Request Terminal Parameters (DECREQTPARM)
  555. CSI Ps ; Pu ` z
  556.            Enable Locator Reporting (DECELR)
  557.            Valid values for the first parameter:
  558.          Ps = 0  -> Locator disabled (default)
  559.          Ps = 1  -> Locator enabled
  560.          Ps = 2  -> Locator enabled for one report, then dis-
  561.            abled
  562.            The second parameter specifies the coordinate unit for
  563.            locator reports.
  564.            Valid values for the second parameter:
  565.          Pu = 0  or omitted -> default to character cells
  566.          Pu = 1  -> device physical pixels
  567.          Pu = 2  -> character cells
  568. CSI Pm ` {     Select Locator Events (DECSLE)
  569.            Valid values for the first (and any additional parame-
  570.            ters) are:
  571.          Ps = 0  -> only respond to explicit host requests
  572.            (DECRQLP)
  573.                 (default) also cancels any filter rectangle
  574.          Ps = 1  -> report button down transitions
  575.          Ps = 2  -> do not report button down transitions
  576.          Ps = 3  -> report button up transitions
  577.          Ps = 4  -> do not report button up transitions
  578. CSI Ps ` |     Request Locator Position (DECRQLP)
  579.            Valid values for the parameter are:
  580.          Ps = 0 , 1 or omitted -> transmit a single DECLRP loca-
  581.            tor report
  582.  
  583.            If Locator Reporting has been enabled by a DECELR, xterm
  584.            will respond with a DECLRP Locator Report.  This report
  585.            is also generated on button up and down events if they
  586.            have been enabled with a DECSLE, or when the locator is
  587.            detected outside of a filter rectangle, if filter rectan-
  588.            gles have been enabled with a DECEFR.
  589.  
  590.          -> CSI Pe ; Pb ; Pr ; Pc ; Pp &  w
  591.  
  592.            Parameters are [event;button;row;column;page].
  593.            Valid values for the event:
  594.          Pe = 0  -> locator unavailable - no other parameters
  595.            sent
  596.          Pe = 1  -> request - xterm received a DECRQLP
  597.          Pe = 2  -> left button down
  598.          Pe = 3  -> left button up
  599.          Pe = 4  -> middle button down
  600.          Pe = 5  -> middle button up
  601.          Pe = 6  -> right button down
  602.          Pe = 7  -> right button up
  603.          Pe = 8  -> M4 button down
  604.          Pe = 9  -> M4 button up
  605.          Pe = 1 0  -> locator outside filter rectangle
  606.            ``button'' parameter is a bitmask indicating which but-
  607.            tons are pressed:
  608.          Pb = 0  -> no buttons down
  609.          Pb & 1  -> right button down
  610.          Pb & 2  -> middle button down
  611.          Pb & 4  -> left button down
  612.          Pb & 8  -> M4 button down
  613.            ``row'' and ``column'' parameters are the coordinates of
  614.            the locator position in the xterm window, encoded as
  615.            ASCII decimal.
  616.            The ``page'' parameter is not used by xterm, and will be
  617.            omitted.
  618.  
  619. Operating System Controls
  620. OSC Ps ; Pt ST
  621. OSC Ps ; Pt BEL
  622.            Set Text Parameters.  For colors and font, if Pt is a
  623.            "?", the control sequence elicits a response which con-
  624.            sists of the control sequence which would set the corre-
  625.            sponding value.    The dtterm control sequences allow you
  626.            to determine the icon name and window title.
  627.          Ps = 0  -> Change Icon Name and Window Title to Pt
  628.          Ps = 1  -> Change Icon Name to Pt
  629.          Ps = 2  -> Change Window Title to Pt
  630.          Ps = 3  -> Set X property on top-level window. Pt
  631.            should be in the form "prop=value", or just "prop" to
  632.            delete the property
  633.          Ps = 4  ; c ; name -> Change Color #c to cname.  Any
  634.            number of c name pairs may be given.
  635.          Ps = 1 0  -> Change color names starting with text
  636.            foreground to Pt (a list of one or more color names or
  637.            RGB specifications, separated by semicolon, up to eight,
  638.            as per XParseColor).
  639.          Ps = 1 1  -> Change colors starting with text back-
  640.            ground to Pt
  641.          Ps = 1 2  -> Change colors starting with text cursor to
  642.            Pt
  643.          Ps = 1 3  -> Change colors starting with mouse fore-
  644.            ground to Pt
  645.          Ps = 1 4  -> Change colors starting with mouse back-
  646.            ground to Pt
  647.          Ps = 1 5  -> Change colors starting with Tek foreground
  648.            to Pt
  649.          Ps = 1 6  -> Change colors starting with Tek background
  650.            to Pt
  651.          Ps = 1 7  -> Change colors starting with highlight to
  652.            Pt
  653.          Ps = 4 6  -> Change Log File to Pt (normally disabled
  654.            by a compile-time option)
  655.          Ps = 5 0  -> Set Font to Pt If Pt begins with a "#",
  656.            index in the font menu, relative (if the next character
  657.            is a plus or minus sign) or absolute.  A number is
  658.            expected but not required after the sign (the default is
  659.            the current entry for relative, zero for absolute index-
  660.            ing).
  661.  
  662. Privacy Message
  663. PM Pt ST       xterm implements no PM functions; Pt is ignored.  Pt need
  664.            not be printable characters.
  665.  
  666. PC-Style Function Keys
  667. If xterm does minimal translation of the function keys, it usually does
  668. this with a PC-style keyboard, so PC-style function keys result.  Sun
  669. keyboards are similar to PC keyboards.    Both have cursor and scrolling
  670. operations printed on the keypad, which duplicate the smaller cursor and
  671. scrolling keypads.
  672. X does not predefine NumLock (used for VT220 keyboards) or Alt (used as
  673. an extension for the Sun/PC keyboards) as modifiers.  These keys are
  674. recognized as modifiers when enabled by the numLock resource, or by the
  675. DECSET 1 0 3 5    control sequence.
  676. The cursor keys transmit the following escape sequences depending on the
  677. mode specified via the DECCKM escape sequence.
  678.  
  679.               Key      Normal    Application
  680.           --------------------------------------
  681.           Cursor Up     CSI A        SS3 A
  682.           Cursor Down     CSI B        SS3 B
  683.           Cursor Right     CSI C        SS3 C
  684.           Cursor Left     CSI D        SS3 D
  685.  
  686. The application keypad transmits the following escape sequences depend-
  687. ing on the mode specified via the DECPNM and DECPAM escape sequences.
  688. Use the NumLock key to override the application mode.
  689. Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are
  690. supported by the program.
  691.  
  692.        Key           Numeric      Application    Terminfo   Termcap
  693.       --------------------------------------------------------------
  694.       Space           SP      SS3 SP    -       -
  695.       Tab           TAB      SS3 I     -       -
  696.       Enter           CR      SS3 M     kent       @8
  697.       PF1           SS3 P      SS3 P     kf1       k1
  698.       PF2           SS3 Q      SS3 Q     kf2       k2
  699.       PF3           SS3 R      SS3 R     kf3       k3
  700.       PF4           SS3 S      SS3 S     kf4       k4
  701.       * (multiply)     *      SS3 j     -       -
  702.       + (add)           +      SS3 k     -       -
  703.       , (comma)        ,      SS3 l     -       -
  704.       - (minus)        -      SS3 m     -       -
  705.       . (Delete)       .      SS3 3 ~    -       -
  706.       / (divide)       /      SS3 o     -       -
  707.       0 (Insert)       0      CSI 2 ~    -       -
  708.       1 (End)           1      CSI 4 ~    kc1       K4
  709.       2 (DownArrow)    2      CSI B     -       -
  710.       3 (PageDown)     3      CSI 5 ~    kc3       K5
  711.       4 (LeftArrow)    4      CSI D     -       -
  712.       5 (Begin)        5      CSI E     kb2       K2
  713.       6 (RightArrow)   6      CSI C     -       -
  714.       7 (Home)           7      CSI 1 ~    ka1       K1
  715.       8 (UpArrow)      8      CSI A     -       -
  716.       9 (PageUp)       9      CSI 5 ~    ka3       K3
  717.       = (equal)        =      SS3 X     -       -
  718.  
  719. They also provide 12 function keys, as well as a few other special-pur-
  720. pose keys.
  721.  
  722.              Key      Escape Sequence
  723.                ---------------------------
  724.                F1      SS3 P
  725.                F2      SS3 Q
  726.                F3      SS3 R
  727.                F4      SS3 S
  728.                F5      CSI 1 5 ~
  729.                F6      CSI 1 7 ~
  730.                F7      CSI 1 8 ~
  731.                F8      CSI 1 9 ~
  732.                F9      CSI 2 0 ~
  733.                F10      CSI 2 1 ~
  734.                F11      CSI 2 3 ~
  735.                F12      CSI 2 4 ~
  736.  
  737. Older versions of xterm implement different escape sequences for F1
  738. through F4.  These can be activated by setting the oldXtermFKeys
  739. resource.  However, since they do not correspond to any hardware termi-
  740. nal, they have been deprecated.  (The DEC VT220 reserves F1 through F5
  741. for local functions such as Setup).
  742.  
  743.              Key      Escape Sequence
  744.                ---------------------------
  745.                F1      CSI 1 1 ~
  746.                F2      CSI 1 2 ~
  747.                F3      CSI 1 3 ~
  748.                F4      CSI 1 4 ~
  749.  
  750. In normal mode, i.e., a Sun/PC keyboard when the sunKeyboard resource is
  751. false, xterm recognizes function key modifiers which are parameters
  752. appended before the final character of the control sequence.
  753.  
  754.               Code     Modifiers
  755.             ---------------------------------
  756.                2       Shift
  757.                3       Alt
  758.                4       Shift + Alt
  759.                5       Control
  760.                6       Shift + Control
  761.                7       Alt + Control
  762.                8       Shift + Alt + Control
  763.  
  764. For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
  765.  
  766. VT220-Style Function Keys
  767. However, xterm is most useful as a DEC VT102 or VT220 emulator.  Set the
  768. sunKeyboard resource to true to force a Sun/PC keyboard to act like a
  769. VT220 keyboard.
  770. The VT102/VT220 application keypad transmits unique escape sequences in
  771. application mode, which are distinct from the cursor and scrolling key-
  772. pad:
  773.  
  774.               Key     Numeric    Application
  775.           --------------------------------------
  776.           Space      Space        SS3 SP
  777.           Tab         Tab        SS3 I
  778.           Enter      CR        SS3 M
  779.           PF1         SS3 P        SS3 P
  780.           PF2         SS3 Q        SS3 Q
  781.           PF3         SS3 R        SS3 R
  782.           PF4         SS3 S        SS3 S
  783.           * (multiply)     *        SS3 j
  784.           + (add)     +        SS3 k
  785.           , (comma)     ,        SS3 l
  786.           - (minus)     -        SS3 m
  787.           . (period)     .        SS3 n
  788.           / (divide)     /        SS3 o
  789.           0         0        SS3 p
  790.           1         1        SS3 q
  791.           2         2        SS3 r
  792.           3         3        SS3 s
  793.           4         4        SS3 t
  794.           5         5        SS3 u
  795.           6         6        SS3 v
  796.           7         7        SS3 w
  797.           8         8        SS3 x
  798.           9         9        SS3 y
  799.           = (equal)     =        SS3 X
  800.  
  801. The VT220 provides 8 additional function keys.    With a Sun/PC keyboard,
  802. access these keys by Control/F1 for F13, etc.
  803.  
  804.              Key      Escape Sequence
  805.                ---------------------------
  806.                F13      CSI 2 5 ~
  807.                F14      CSI 2 6 ~
  808.                F15      CSI 2 8 ~
  809.                F16      CSI 2 9 ~
  810.                F17      CSI 3 1 ~
  811.                F18      CSI 3 2 ~
  812.                F19      CSI 3 3 ~
  813.                F20      CSI 3 4 ~
  814.  
  815.  
  816. VT52-Style Function Keys
  817. A VT52 does not have function keys, but it does have a numeric keypad
  818. and cursor keys.  They differ from the other emulations by the prefix.
  819. Also, the cursor keys do not change:
  820.  
  821.                Key      Normal/Application
  822.            ----------------------------------
  823.            Cursor Up      ESC A
  824.            Cursor Down      ESC B
  825.            Cursor Right   ESC C
  826.            Cursor Left      ESC D
  827.  
  828. The keypad is similar:
  829.  
  830.               Key     Numeric    Application
  831.           --------------------------------------
  832.           Space      Space        ESC ? SP
  833.           Tab         Tab        ESC ? I
  834.           Enter      CR        ESC ? M
  835.           PF1         ESC P        ESC P
  836.           PF2         ESC Q        ESC Q
  837.           PF3         ESC R        ESC R
  838.           PF4         ESC S        ESC S
  839.           * (multiply)     *        ESC ? j
  840.           + (add)     +        ESC ? k
  841.           , (comma)     ,        ESC ? l
  842.           - (minus)     -        ESC ? m
  843.           . (period)     .        ESC ? n
  844.           / (divide)     /        ESC ? o
  845.           0         0        ESC ? p
  846.           1         1        ESC ? q
  847.           2         2        ESC ? r
  848.           3         3        ESC ? s
  849.           4         4        ESC ? t
  850.           5         5        ESC ? u
  851.           6         6        ESC ? v
  852.           7         7        ESC ? w
  853.           8         8        ESC ? x
  854.           9         9        ESC ? y
  855.           = (equal)     =        ESC ? X
  856.  
  857.  
  858. Sun-Style Function Keys
  859. The xterm program provides support for Sun keyboards more directly, by a
  860. menu toggle that causes it to send Sun-style function key codes rather
  861. than VT220.  Note, however, that the sun and vt100 emulations are not
  862. really compatible.  For example, their wrap-margin behavior differs.
  863. Only function keys are altered; keypad and cursor keys are the same.
  864. The emulation responds identically.  See the xterm-sun terminfo entry
  865. for details.
  866.  
  867. HP-Style Function Keys
  868. Similarly, xterm can be compiled to support HP keyboards.  See the
  869. xterm-hp terminfo entry for details.
  870.  
  871. Mouse Tracking
  872. The VT widget can be set to send the mouse position and other informa-
  873. tion on button presses.  These modes are typically used by editors and
  874. other full-screen applications that want to make use of the mouse.
  875.  
  876. There are six mutually exclusive modes.  One is DEC Locator mode,
  877. enabled by the DECELR CSI Ps ; Ps  'z control sequence, and is not
  878. described here.  The remaining five modes are each enabled (or disabled)
  879. by a different parameter in DECSET CSI ? Pm h or DECRST CSI ? Pm l con-
  880. trol sequence.
  881.  
  882. Manifest constants for the parameter values are defined in xcharmouse.h
  883. as follows:
  884.  
  885.         #define SET_X10_MOUSE            9
  886.         #define SET_VT200_MOUSE         1000
  887.         #define SET_VT200_HIGHLIGHT_MOUSE   1001
  888.         #define SET_BTN_EVENT_MOUSE        1002
  889.         #define SET_ANY_EVENT_MOUSE        1003
  890.  
  891. The motion reporting modes are strictly xterm extensions, and are not
  892. part of any standard, though they are analogous to the DEC VT200 DECELR
  893. locator reports.
  894.  
  895. Parameters (such as pointer position and button number) for all mouse
  896. tracking escape sequences generated by xterm encode numeric parameters
  897. in a single character as value+32.  For example, !  specifies the value
  898. 1.  The upper left character position on the terminal is denoted as 1,1.
  899.  
  900. X10 compatibility mode sends an escape sequence only on button press,
  901. encoding the location and the mouse button pressed.  It is enabled by
  902. specifying parameter 9 to DECSET.  On button press, xterm sends CSI M
  903. CbCxCy (6 characters).    Cb is button-1.  Cx and Cy are the x and y coor-
  904. dinates of the mouse when the button was pressed.
  905.  
  906. Normal tracking mode sends an escape sequence on both button press and
  907. release.  Modifier key (shift, ctrl, meta) information is also sent.  It
  908. is enabled by specifying parameter 1000 to DECSET.  On button press or
  909. release, xterm sends CSI M CbCxCy.  The low two bits of Cb encode button
  910. information: 0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release.
  911. The next three bits encode the modifiers which were down when the button
  912. was pressed and are added together:  4=Shift, 8=Meta, 16=Control.  Note
  913. however that the shift and control bits are normally unavailable because
  914. xterm uses the control modifier with mouse for popup menus, and the
  915. shift modifier is used in the default translations for button events.
  916. The Meta modifier recognized by xterm is the mod1 mask, and is not nec-
  917. essarily the "Meta" key (see xmodmap).    Cx and Cy are the x and y coor-
  918. dinates of the mouse event, encoded as in X10 mode.
  919.  
  920. Wheel mice may return buttons 4 and 5.    Those buttons are represented by
  921. adding 64 to the event code.
  922.  
  923. Mouse hilite tracking notifies a program of a button press, receives a
  924. range of lines from the program, highlights the region covered by the
  925. mouse within that range until button release, and then sends the program
  926. the release coordinates.  It is enabled by specifying parameter 1001 to
  927. DECSET.  Highlighting is performed only for button 1, though other but-
  928. ton events can be received.  Warning: use of this mode requires a coop-
  929. erating program or it will hang xterm.    On button press, the same infor-
  930. mation as for normal tracking is generated; xterm then waits for the
  931. program to send mouse tracking information.  All X events are ignored
  932. until the proper escape sequence is received from the pty: CSI Ps ; Ps ;
  933. Ps ; Ps ; Ps T .  The parameters are func, startx, starty, firstrow, and
  934. lastrow.  func is non-zero to initiate hilite tracking and zero to
  935. abort.    startx and starty give the starting x and y location for the
  936. highlighted region.  The ending location tracks the mouse, but will
  937. never be above row firstrow and will always be above row lastrow.  (The
  938. top of the screen is row 1.)  When the button is released, xterm reports
  939. the ending position one of two ways: if the start and end coordinates
  940. are valid text locations: CSI t CxCy.  If either coordinate is past the
  941. end of the line: CSI T CxCyCxCyCxCy.  The parameters are startx, starty,
  942. endx, endy, mousex, and mousey.  startx, starty, endx, and endy give the
  943. starting and ending character positions of the region.    mousex and
  944. mousey give the location of the mouse at button up, which may not be
  945. over a character.
  946.  
  947. Button-event tracking is essentially the same as normal tracking, but
  948. xterm also reports button-motion events.  Motion events are reported
  949. only if the mouse pointer has moved to a different character cell.  It
  950. is enabled by specifying parameter 1002 to DECSET.  On button press or
  951. release, xterm sends the same codes used by normal tracking mode.  On
  952. button-motion events, xterm adds 32 to the event code (the third charac-
  953. ter, Cb).  The other bits of the event code specify button and modifier
  954. keys as in normal mode.  For example, motion into cell x,y with button 1
  955. down is reported as CSI M @ CxCy.  ( @    = 32 + 0 (button 1) + 32 (motion
  956. indicator) ).  Similarly, motion with button 3 down is reported as CSI M
  957. B CxCy.  ( B  = 32 + 2 (button 3) + 32 (motion indicator) ).
  958.  
  959. Any-event mode is the same as button-event mode, except that all motion
  960. events are reported instead of just those that enter a new character
  961. cell.  It is enabled by specifying 1003 to DECSET.
  962.  
  963. Tektronix 4014 Mode
  964. Most of these sequences are standard Tektronix 4014 control sequences.
  965. Graph mode supports the 12-bit addressing of the Tektronix 4014.  The
  966. major features missing are the write-through and defocused modes.  This
  967. document does not describe the commands used in the various Tektronix
  968. plotting modes but does describe the commands to switch modes.
  969.  
  970. BEL           Bell (Ctrl-G)
  971. BS           Backspace (Ctrl-H)
  972. TAB           Horizontal Tab (Ctrl-I)
  973. LF           Line Feed or New Line (Ctrl-J)
  974. VT           Cursor up (Ctrl-K)
  975. FF           Form Feed or New Page (Ctrl-L)
  976. CR           Carriage Return (Ctrl-M)
  977. ESC ETX        Switch to VT100 Mode (ESC Ctrl-C)
  978. ESC ENQ        Return Terminal Status (ESC Ctrl-E)
  979. ESC FF           PAGE (Clear Screen) (ESC Ctrl-L)
  980. ESC SO           Begin 4015 APL mode (ignored by xterm) (ESC Ctrl-N)
  981. ESC SI           End 4015 APL mode (ignored by xterm) (ESC Ctrl-O)
  982. ESC ETB        COPY (Save Tektronix Codes to file COPYyyyy-mm-
  983.            dd.hh:mm:ss) (ESC Ctrl-W)
  984. ESC CAN        Bypass Condition (ESC Ctrl-X)
  985. ESC SUB        GIN mode (ESC Ctrl-Z)
  986. ESC FS           Special Point Plot Mode (ESC Ctrl-\)
  987. ESC 8           Select Large Character Set
  988. ESC 9           Select #2 Character Set
  989. ESC :           Select #3 Character Set
  990. ESC ;           Select Small Character Set
  991. OSC Ps ; Pt BEL
  992.            Set Text Parameters of VT window
  993.          Ps = 0  -> Change Icon Name and Window Title to Pt
  994.          Ps = 1  -> Change Icon Name to Pt
  995.          Ps = 2  -> Change Window Title to Pt
  996.          Ps = 4 6  -> Change Log File to Pt (normally disabled
  997.            by a compile-time option)
  998. ESC `           Normal Z Axis and Normal (solid) Vectors
  999. ESC a           Normal Z Axis and Dotted Line Vectors
  1000. ESC b           Normal Z Axis and Dot-Dashed Vectors
  1001. ESC c           Normal Z Axis and Short-Dashed Vectors
  1002. ESC d           Normal Z Axis and Long-Dashed Vectors
  1003. ESC h           Defocused Z Axis and Normal (solid) Vectors
  1004. ESC i           Defocused Z Axis and Dotted Line Vectors
  1005. ESC j           Defocused Z Axis and Dot-Dashed Vectors
  1006. ESC k           Defocused Z Axis and Short-Dashed Vectors
  1007. ESC l           Defocused Z Axis and Long-Dashed Vectors
  1008. ESC p           Write-Thru Mode and Normal (solid) Vectors
  1009. ESC q           Write-Thru Mode and Dotted Line Vectors
  1010. ESC r           Write-Thru Mode and Dot-Dashed Vectors
  1011. ESC s           Write-Thru Mode and Short-Dashed Vectors
  1012. ESC t           Write-Thru Mode and Long-Dashed Vectors
  1013. FS           Point Plot Mode (Ctrl-\)
  1014. GS           Graph Mode (Ctrl-])
  1015. RS           Incremental Plot Mode (Ctrl-^)
  1016. US           Alpha Mode (Ctrl-_)
  1017.  
  1018. VT52 Mode
  1019. Parameters for cursor movement are at the end of the ESC Y  escape
  1020. sequence.  Each ordinate is encoded in a single character as value+32.
  1021. For example, !    is 1.  The screen coodinate system is 0-based.
  1022.  
  1023. ESC A           Cursor up.
  1024. ESC B           Cursor down.
  1025. ESC C           Cursor right.
  1026. ESC D           Cursor left.
  1027. ESC F           Enter graphics mode.
  1028. ESC G           Exit graphics mode.
  1029. ESC H           Move the cursor to the home position.
  1030. ESC I           Reverse line feed.
  1031. ESC J           Erase from the cursor to the end of the screen.
  1032. ESC K           Erase from the cursor to the end of the line.
  1033. ESC Y Ps Ps    Move the cursor to given row and column.
  1034. ESC Z           Identify
  1035.          -> ESC  /  Z  (``I am a VT52.'')
  1036. ESC =           Enter alternate keypad mode.
  1037. ESC >           Exit alternate keypad mode.
  1038. ESC <           Exit VT52 mode (Enter VT100 mode).
  1039.