home *** CD-ROM | disk | FTP | other *** search
/ Enter 1999 April - Disc 1 / enter_04_1999_1.iso / OS2 / XFREE86 / XDOC.ZIP / XFree86 / lib / X11 / doc / ctlseqs.TXT < prev    next >
Encoding:
Text File  |  1999-01-09  |  27.2 KB  |  866 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.             Xterm Control Sequences
  11.  
  12.  
  13.                    Edward Moy
  14.  
  15.            University of California, Berkeley
  16.  
  17.                    Revised by
  18.  
  19.  
  20.                  Stephen Gildea
  21.  
  22.               X Consortium (1994)
  23.  
  24.  
  25.                  Thomas Dickey
  26.  
  27.              XFree86 Project (1996)
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. Definitions
  37.  
  38. c    The literal character c.
  39.  
  40. C    A single (required) character.
  41.  
  42. Ps   A single (usually optional) numeric parameter, composed of    one of
  43.      more digits.
  44.  
  45. Pm   A multiple    numeric    parameter composed of any number of single
  46.      numeric parameters, separated by ;     character(s).
  47.  
  48. Pt   A text parameter composed of printable characters.
  49.  
  50. C1 (8-Bit) Control Characters
  51.  
  52. The xterm program recognizes both 8-bit    and 7-bit control characters.
  53. It generates 7-bit controls (by    default) or 8-bit if S8C1T is enabled.
  54. The following pairs of 7-bit and 8-bit control characters are
  55. equivalent:
  56.  
  57.  
  58. ESC D           Index (IND: 0x84)
  59. ESC E           Next Line (NEL: 0x85)
  60.  
  61. ESC H           Tab Set (HTS: 0x88)
  62. ESC M           Reverse Index (RI: 0x8d)
  63.  
  64. ESC N           Single Shift Select of G2 Character Set (SS2: 0x8e):
  65.            affects next character only
  66.  
  67. ESC O           Single Shift Select of G3 Character Set (SS3: 0x8f):
  68.            affects next character only
  69.  
  70. ESC P           Device Control String (DCS: 0x90)
  71. ESC V           Start of    Guarded    Area (SPA: 0x96)
  72.  
  73. ESC W           End of Guarded Area (EPA: 0x97)
  74. ESC X           Start of    String (SOS: 0x98)
  75.  
  76. ESC Z           Return Terminal ID (DECID: 0x9a).  Obsolete form    of CSI c
  77.            (DA).
  78.  
  79. ESC [           Control Sequence    Introducer (CSI: 0x9b)
  80. ESC \           String Terminator (ST: 0x9c)
  81.  
  82. ESC ]           Operating System    Command    (OSC: 0x9d)
  83. ESC ^           Privacy Message (PM: 0x9e)
  84.  
  85. ESC _           Application Program Command (APC: 0x9f)
  86.  
  87.  
  88. These control characters are used in the vtXXX emulation.
  89.  
  90. VT100 Mode
  91. Most of    these control sequences    are standard VT102 control sequences,
  92. but there is support for later DEC VT terminals    (i.e., VT220 and VT320),
  93. as well    as ISO 6429 and    aixterm    color controls.     VT102 features    not sup-
  94. ported are auto-repeat and blinking characters.     There are additional
  95. control    sequences to provide xterm-dependent functions,    such as    the
  96. scrollbar or window size.  Where the function is specified by DEC or ISO
  97. 6429, the code assigned    to it is given in parentheses.    The escape codes
  98. to designate and invoke    character sets are specified by    ISO 2022; see
  99. that document for a discussion of character sets.
  100.  
  101.  
  102. BEL           Bell (Ctrl-G)
  103. BS           Backspace (Ctrl-H)
  104.  
  105. CR           Carriage    Return (Ctrl-M)
  106. ENQ           Return Terminal Status (Ctrl-E).     Response is the termi-
  107.  
  108.            nal name, e.g., "xterm".
  109. FF           Form Feed or New    Page (NP) (Ctrl-L) same    as LF
  110.  
  111. LF           Line Feed or New    Line (NL) (Ctrl-J)
  112. SO           Shift Out (Ctrl-N) -> Switch to Alternate Character Set:
  113.  
  114.            invokes the G1 character    set.
  115. SP           Space.
  116.  
  117. TAB           Horizontal Tab (HT) (Ctrl-I)
  118. VT           Vertical    Tab (Ctrl-K) same as LF
  119.  
  120. SI           Shift In    (Ctrl-O) -> Switch to Standard Character Set:
  121.            invokes the G0 character    set (the default).
  122.  
  123.  
  124. ESC SP F       7-bit controls (S7C1T).
  125.  
  126. ESC SP G       8-bit controls (S8C1T).
  127. ESC SP L       Set ANSI    conformance level 1 (vt100, 7-bit controls).
  128.  
  129. ESC SP M       Set ANSI    conformance level 2 (vt200).
  130. ESC SP N       Set ANSI    conformance level 3 (vt300).
  131.  
  132. ESC # 3           DEC double-height line, top half    (DECDHL)
  133. ESC # 4           DEC double-height line, bottom half (DECDHL)
  134.  
  135. ESC # 5           DEC single-width    line (DECSWL)
  136. ESC # 6           DEC double-width    line (DECDWL)
  137.  
  138. ESC # 8           DEC Screen Alignment Test (DECALN)
  139. ESC ( C           Designate G0 Character Set (ISO 2022)
  140.  
  141. ESC ) C           Designate G1 Character Set (ISO 2022)
  142. ESC * C           Designate G2 Character Set (ISO 2022)
  143.  
  144. ESC + C           Designate G3 Character Set (ISO 2022)
  145.            Final character C for designating character sets    (0 , A
  146.  
  147.            and B  apply to VT100 and up, the remainder to VT220 and
  148.            up):
  149.  
  150.          C = 0    -> DEC Special Character and Line Drawing Set
  151.          C = A    -> United Kingdom (UK)
  152.  
  153.          C = B    -> United States (USASCII)
  154.          C = 4    -> Dutch
  155.  
  156.          C = C    or 5  -> Finnish
  157.          C = R    -> French
  158.  
  159.          C = Q    -> French Canadian
  160.          C = K    -> German
  161.  
  162.          C = Y    -> Italian
  163.          C = E    or 6  -> Norwegian/Danish
  164.  
  165.          C = Z    -> Spanish
  166.          C = H    or 7  -> Swedish
  167.  
  168.          C = =    -> Swiss
  169. ESC 7           Save Cursor (DECSC)
  170.  
  171. ESC 8           Restore Cursor (DECRC)
  172. ESC =           Application Keypad (DECPAM)
  173.  
  174. ESC >           Normal Keypad (DECPNM)
  175. ESC F           Cursor to lower left corner of screen (if enabled by the
  176.  
  177.            hpLowerleftBugCompat resource).
  178. ESC c           Full Reset (RIS)
  179.  
  180. ESC l           Memory Lock (per    HP terminals).    Locks memory above the
  181.            cursor.
  182.  
  183. ESC m           Memory Unlock (per HP terminals)
  184. ESC n           Invoke the G2 Character Set (LS2)
  185.  
  186. ESC o           Invoke the G3 Character Set (LS3)
  187. ESC |           Invoke the G3 Character Set as GR (LS3R).  Has no visible
  188.  
  189.            effect in xterm.
  190. ESC }           Invoke the G2 Character Set as GR (LS2R).  Has no visible
  191.  
  192.            effect in xterm.
  193. ESC ~           Invoke the G1 Character Set as GR (LS1R).  Has no visible
  194.  
  195.            effect in xterm.
  196.  
  197.  
  198. APC Pt ST      xterm implements    no APC functions; Pt is    ignored.  Pt
  199.            need not    be printable characters.
  200.  
  201.  
  202. DCS Ps;    Ps| Pt ST
  203.  
  204.            User-Defined Keys (DECUDK).  The    first parameter:
  205.          Ps = 0     -> Clear all UDK definitions before starting
  206.  
  207.            (default)
  208.          Ps = 1     -> Erase Below    (default)
  209.  
  210.            The second parameter:
  211.          Ps = 0     -> Lock the keys (default)
  212.  
  213.          Ps = 1     -> Do not lock.
  214.            The third parameter is a    ';'-separated list of strings
  215.  
  216.            denoting    the key-code separated by a '/'    from the hex-
  217.            encoded key value.  The key codes correspond to the DEC
  218.  
  219.            function-key codes (e.g., F6=17).
  220. DCS $ q    Pt ST  Request Status String (DECRQSS).     The string following
  221.  
  222.            the "q" is one of the following:
  223.           q          -> DECSCA
  224.  
  225.           p          -> DECSCL
  226.          r          -> DECSTBM
  227.  
  228.          m          -> SGR
  229.            xterm responds with DCS 1 $ r Pt    ST for valid requests,
  230.  
  231.            replacing the Pt    with the corresponding CSI string, or
  232.            DCS 0 $ r Pt ST for invalid requests.
  233.  
  234.  
  235. CSI Ps @       Insert Ps (Blank) Character(s) (default = 1) (ICH)
  236.  
  237. CSI Ps A       Cursor Up Ps Times (default = 1)    (CUU)
  238. CSI Ps B       Cursor Down Ps Times (default = 1) (CUD)
  239.  
  240. CSI Ps C       Cursor Forward Ps Times (default    = 1) (CUF)
  241. CSI Ps D       Cursor Backward Ps Times    (default = 1) (CUB)
  242.  
  243. CSI Ps E       Cursor Next Line    Ps Times (default = 1) (CNL)
  244. CSI Ps F       Cursor Preceding    Line Ps    Times (default = 1) (CPL)
  245.  
  246. CSI Ps G       Cursor Character    Absolute  [column] (default = [row,1])
  247.            (CHA)
  248.  
  249. CSI Ps ; Ps H  Cursor Position [row;column] (default = [1,1]) (CUP)
  250. CSI Ps I       Cursor Forward Tabulation Ps tab    stops (default = 1)
  251.  
  252.            (CHT)
  253. CSI Ps J       Erase in    Display    (ED)
  254.  
  255.          Ps = 0     -> Erase Below    (default)
  256.          Ps = 1     -> Erase Above
  257.  
  258.          Ps = 2     -> Erase All
  259. CSI ? Ps J     Erase in    Display    (DECSED)
  260.  
  261.          Ps = 0     -> Selective Erase Below (default)
  262.          Ps = 1     -> Selective Erase Above
  263.  
  264.          Ps = 2     -> Selective Erase All
  265. CSI Ps K       Erase in    Line (EL)
  266.  
  267.          Ps = 0     -> Erase to Right (default)
  268.          Ps = 1     -> Erase to Left
  269.  
  270.          Ps = 2     -> Erase All
  271. CSI ? Ps K     Erase in    Line (DECSEL)
  272.  
  273.          Ps = 0     -> Selective Erase to Right (default)
  274.          Ps = 1     -> Selective Erase to Left
  275.  
  276.          Ps = 2     -> Selective Erase All
  277. CSI Ps L       Insert Ps Line(s) (default = 1) (IL)
  278.  
  279. CSI Ps M       Delete Ps Line(s) (default = 1) (DL)
  280. CSI Ps P       Delete Ps Character(s) (default = 1) (DCH)
  281.  
  282. CSI Ps S       Scroll up Ps lines (default = 1)    (SU)
  283. CSI Ps T       Scroll down Ps lines (default = 1) (SD, according to DEC)
  284.  
  285. CSI Ps ; Ps ; Ps ; Ps ;    Ps T
  286.            Initiate    hilite mouse tracking.    Parameters are
  287.  
  288.            [func;startx;starty;firstrow;lastrow].  See the section
  289.            Mouse Tracking.
  290.  
  291. CSI Ps X       Erase Ps    Character(s) (default =    1) (ECH)
  292. CSI Ps Z       Cursor Backward Tabulation Ps tab stops (default    = 1)
  293.  
  294.            (CBT)
  295. CSI Ps ^       Scroll down Ps lines (default = 1) (SD, according to ISO)
  296.  
  297. CSI Pm `       Character Position Absolute  [column] (default =    [row,1])
  298.            (HPA)
  299.  
  300. CSI Ps b       Repeat the preceding graphic character Ps times (REP)
  301. CSI Ps c       Send Device Attributes (DA)
  302.  
  303.          Ps = 0     or omitted -> request attributes from terminal
  304.          -> CSI    ? 1 ; 2    c  (``I    am a VT100 with    Advanced Video
  305.  
  306.            Option.'')
  307. CSI Pm d       Line Position Absolute  [row] (default =    [1,column])
  308.  
  309.            (VPA)
  310. CSI Ps ; Ps f  Horizontal and Vertical Position    [row;column] (default =
  311.  
  312.            [1,1]) (HVP)
  313. CSI Ps g       Tab Clear (TBC)
  314.  
  315.          Ps = 0     -> Clear Current Column (default)
  316.          Ps = 3     -> Clear All
  317.  
  318. CSI Pm h       Set Mode    (SM)
  319.          Ps = 2     -> Keyboard Action Mode (AM)
  320.  
  321.          Ps = 4     -> Insert Mode    (IRM)
  322.          Ps = 1    2  -> Send/receive (SRM)
  323.  
  324.          Ps = 2    0  -> Automatic    Newline    (LNM)
  325. CSI Pm i       Media Copy (MC)
  326.  
  327.          Ps = 0     -> Print screen (default)
  328.          Ps = 4     -> Turn off printer controller    mode
  329.  
  330.          Ps = 5     -> Turn on printer controller mode
  331. CSI ? Pm i     Media Copy (MC, DEC-specific)
  332.  
  333.          Ps = 1     -> Print line containing cursor
  334.          Ps = 4     -> Turn off autoprint mode
  335.  
  336.          Ps = 5     -> Turn on autoprint mode
  337. CSI Pm l       Reset Mode (RM)
  338.  
  339.          Ps = 2     -> Keyboard Action Mode (AM)
  340.          Ps = 4     -> Replace Mode (IRM)
  341.  
  342.          Ps = 1    2  -> Send/receive (SRM)
  343.          Ps = 2    0  -> Normal Linefeed (LNM)
  344.  
  345. CSI Pm m       Character Attributes (SGR)
  346.          Ps = 0     -> Normal (default)
  347.  
  348.          Ps = 1     -> Bold
  349.          Ps = 4     -> Underlined
  350.  
  351.          Ps = 5     -> Blink (appears as Bold)
  352.          Ps = 7     -> Inverse
  353.  
  354.          Ps = 8     -> Invisible (hidden)
  355.          Ps = 2    2  -> Normal (neither bold nor faint)
  356.  
  357.          Ps = 2    4  -> Not underlined
  358.          Ps = 2    5  -> Steady (not blinking)
  359.  
  360.          Ps = 2    7  -> Positive (not inverse)
  361.          Ps = 2    8  -> Visible (not hidden)
  362.  
  363.          Ps = 3    0  -> Set foreground color to Black
  364.          Ps = 3    1  -> Set foreground color to Red
  365.  
  366.          Ps = 3    2  -> Set foreground color to Green
  367.          Ps = 3    3  -> Set foreground color to Yellow
  368.  
  369.          Ps = 3    4  -> Set foreground color to Blue
  370.          Ps = 3    5  -> Set foreground color to Magenta
  371.  
  372.          Ps = 3    7  -> Set foreground color to Cyan
  373.          Ps = 3    7  -> Set foreground color to White
  374.  
  375.          Ps = 3    9  -> Set foreground color to default (original)
  376.          Ps = 4    0  -> Set background color to Black
  377.  
  378.          Ps = 4    1  -> Set background color to Red
  379.          Ps = 4    2  -> Set background color to Green
  380.  
  381.          Ps = 4    3  -> Set background color to Yellow
  382.          Ps = 4    4  -> Set background color to Blue
  383.  
  384.          Ps = 4    5  -> Set background color to Magenta
  385.          Ps = 4    6  -> Set background color to Cyan
  386.  
  387.          Ps = 4    7  -> Set background color to White
  388.          Ps = 4    9  -> Set background color to default (origi-
  389.  
  390.            nal).
  391.  
  392.  
  393.            If 16-color support is compiled,    the following apply.
  394.            Assume that xterm's resources are set so    that the ISO
  395.  
  396.            color codes are the first 8 of a    set of 16.  Then the
  397.            aixterm colors are the bright versions of the ISO colors:
  398.  
  399.          Ps = 9    0  -> Set foreground color to Black
  400.          Ps = 9    1  -> Set foreground color to Red
  401.  
  402.          Ps = 9    2  -> Set foreground color to Green
  403.          Ps = 9    3  -> Set foreground color to Yellow
  404.  
  405.          Ps = 9    4  -> Set foreground color to Blue
  406.          Ps = 9    5  -> Set foreground color to Magenta
  407.  
  408.          Ps = 9    7  -> Set foreground color to Cyan
  409.          Ps = 9    7  -> Set foreground color to White
  410.  
  411.          Ps = 1    0 0  ->    Set background color to    Black
  412.          Ps = 1    0 1  ->    Set background color to    Red
  413.  
  414.          Ps = 1    0 2  ->    Set background color to    Green
  415.          Ps = 1    0 3  ->    Set background color to    Yellow
  416.  
  417.          Ps = 1    0 4  ->    Set background color to    Blue
  418.          Ps = 1    0 5  ->    Set background color to    Magenta
  419.  
  420.          Ps = 1    0 6  ->    Set background color to    Cyan
  421.          Ps = 1    0 7  ->    Set background color to    White
  422.  
  423.  
  424.            If xterm    is compiled with the 16-color support disabled,
  425.  
  426.            it supports the following, from rxvt:
  427.          Ps = 1    0 0  ->    Set foreground and background color to
  428.  
  429.            default
  430.  
  431.  
  432. CSI Ps n       Device Status Report (DSR)
  433.          Ps = 5     -> Status Report CSI 0    n  (``OK'')
  434.  
  435.          Ps = 6     -> Report Cursor Position (CPR) [row;column] as
  436.            CSI r ; c R
  437.  
  438. CSI ? Ps n     Device Status Report (DSR, DEC-specific)
  439.          Ps = 6     -> Report Cursor Position (CPR) [row;column] as
  440.  
  441.            CSI ? r ; c R (assumes page is zero).
  442.          Ps = 1    5  -> Report Printer status as CSI ? 1 0  n
  443.  
  444.            (ready) or CSI ?    1 1  n    (not ready)
  445.          Ps = 2    5  -> Report UDK status    as CSI ? 2 0  n
  446.  
  447.            (unlocked) or CSI ? 2 1    n  (locked)
  448.          Ps = 2    6  -> Report Keyboard status as    CSI ? 2    7  ;  1
  449.  
  450.            ;  0  ;    0  n  (North American)
  451. CSI  ! p       Soft terminal reset (DECSTR)
  452.  
  453. CSI Ps ; Ps  p Set conformance level (DECSCL) Valid values for the first
  454.            parameter:
  455.  
  456.          Ps = 6    1  -> VT100
  457.          Ps = 6    2  -> VT200
  458.  
  459.          Ps = 6    3  -> VT300 Valid values for the second    parame-
  460.            ter:
  461.  
  462.          Ps = 0     -> 8-bit controls
  463.          Ps = 1     -> 7-bit controls (always set for VT100)
  464.  
  465.          Ps = 2     -> 8-bit controls
  466. CSI Ps    q      Select character    protection attribute (DECSCA).    Valid
  467.  
  468.            values for the parameter:
  469.          Ps = 0     -> DECSED and DECSEL can erase    (default)
  470.  
  471.          Ps = 1     -> DECSED and DECSEL cannot erase
  472.          Ps = 2     -> DECSED and DECSEL can erase
  473.  
  474. CSI Ps ; Ps r  Set Scrolling Region [top;bottom] (default = full size of
  475.            window) (DECSTBM)
  476.  
  477. CSI Ps ;  Ps ; Ps t
  478.            Window manipulation (from dtterm).  Valid values    for the
  479.  
  480.            first (and any additional parameters) are:
  481.          Ps = 1     -> Restore (de-iconify) window.
  482.  
  483.          Ps = 2     -> Minimize (iconify) window.
  484.          Ps = 3     ; x ; y -> Move window    to [x, y].
  485.  
  486.          Ps = 4     ; height ; width -> Resize the    xterm window to
  487.            height and width    in pixels.
  488.  
  489.          Ps = 5     -> Raise the xterm window to the front    of the
  490.            stacking    order.
  491.  
  492.          Ps = 6     -> Lower the xterm window to the bottom of the
  493.            stacking    order.
  494.  
  495.          Ps = 7     -> Refresh the    xterm window.
  496.          Ps = 8     ; height ; width -> Resize the    text area to
  497.  
  498.            [height;width] in characters.
  499.          Ps = 1    1  -> Report xterm window state.  If the xterm
  500.  
  501.            window is open (non-iconified), it returns CSI 1    t .  If
  502.            the xterm window    is iconified, it returns CSI 2 t .
  503.  
  504.          Ps = 1    3  -> Report xterm window position as CSI 3 ; x;
  505.            yt
  506.  
  507.          Ps = 1    4  -> Report xterm window in pixels as CSI  4  ;
  508.            height ;     width t
  509.  
  510.          Ps = 1    8  -> Report the size of the text area in char-
  511.            acters as CSI  8     ;  height ;  widtht
  512.  
  513.          Ps = 2    0  -> Report xterm window's icon label as OSC  L
  514.            label ST
  515.  
  516.          Ps = 2    1  -> Report xterm window's title as OSC  l
  517.            title ST
  518.  
  519.          Ps >= 2 4  -> Resize to Ps lines (DECSLPP)
  520. CSI Ps x       Request Terminal    Parameters (DECREQTPARM)
  521.  
  522. CSI ? Pm h     DEC Private Mode    Set (DECSET)
  523.          Ps = 1     -> Application    Cursor Keys (DECCKM)
  524.  
  525.          Ps = 2     -> Designate USASCII for character sets G0-G3
  526.            (DECANM), and set VT100 mode.
  527.  
  528.          Ps = 3     -> 132    Column Mode (DECCOLM)
  529.          Ps = 4     -> Smooth (Slow) Scroll (DECSCLM)
  530.  
  531.          Ps = 5     -> Reverse Video (DECSCNM)
  532.          Ps = 6     -> Origin Mode    (DECOM)
  533.  
  534.          Ps = 7     -> Wraparound Mode (DECAWM)
  535.          Ps = 8     -> Auto-repeat    Keys (DECARM)
  536.  
  537.          Ps = 9     -> Send Mouse X & Y on    button press.  See the
  538.            section Mouse Tracking.
  539.  
  540.          Ps = 1    8  -> Print form feed (DECPFF)
  541.          Ps = 1    9  -> Set print    extent to full screen (DECPEX)
  542.  
  543.          Ps = 2    5  -> Show Cursor (DECTCEM)
  544.          Ps = 3    8  -> Enter Tektronix Mode (DECTEK)
  545.  
  546.          Ps = 4    0  -> Allow 80 -> 132 Mode
  547.          Ps = 4    1  -> more(1) fix (see curses resource)
  548.  
  549.          Ps = 4    2  -> Enable Nation Replacement    Character sets
  550.            (DECNRCM)
  551.  
  552.          Ps = 4    4  -> Turn On Margin Bell
  553.          Ps = 4    5  -> Reverse-wraparound Mode
  554.  
  555.          Ps = 4    6  -> Start Logging (normally disabled by a
  556.            compile-time option)
  557.  
  558.          Ps = 4    7  -> Use Alternate Screen Buffer (unless dis-
  559.            abled by    the titeInhibit    resource)
  560.  
  561.          Ps = 6    7  -> Backarrow    key (DECBKM)
  562.          Ps = 1    0 0 0  -> Send Mouse X & Y on button press and
  563.  
  564.            release.     See the section Mouse Tracking.
  565.          Ps = 1    0 0 1  -> Use Hilite Mouse Tracking.
  566.  
  567.          Ps = 1    0 0 2  -> Use Cell Motion Mouse    Tracking.
  568.          Ps = 1    0 0 3  -> Use All Motion Mouse Tracking.
  569.  
  570.          Ps = 1    0 4 7  -> Use Alternate    Screen Buffer (unless
  571.            disabled    by the titeInhibit resource)
  572.  
  573.          Ps = 1    0 4 8  -> Save cursor as in DECSC (unless dis-
  574.            abled by    the titeInhibit    resource)
  575.  
  576. CSI ? Pm l     DEC Private Mode    Reset (DECRST)
  577.          Ps = 1     -> Normal Cursor Keys (DECCKM)
  578.  
  579.          Ps = 2     -> Designate VT52 mode    (DECANM).
  580.          Ps = 3     -> 80 Column Mode (DECCOLM)
  581.  
  582.          Ps = 4     -> Jump (Fast)    Scroll (DECSCLM)
  583.          Ps = 5     -> Normal Video (DECSCNM)
  584.  
  585.          Ps = 6     -> Normal Cursor Mode (DECOM)
  586.          Ps = 7     -> No Wraparound Mode (DECAWM)
  587.  
  588.          Ps = 8     -> No Auto-repeat Keys    (DECARM)
  589.          Ps = 9     -> Don't Send Mouse X & Y on button press
  590.  
  591.          Ps = 1    8  -> Don't print form feed (DECPFF)
  592.          Ps = 1    9  -> Limit print to scrolling region (DECPEX)
  593.  
  594.          Ps = 2    5  -> Hide Cursor (DECTCEM)
  595.          Ps = 4    0  -> Disallow 80 -> 132 Mode
  596.  
  597.          Ps = 4    1  -> No more(1) fix (see curses resource)
  598.          Ps = 4    2  -> Disable Nation Replacement Character sets
  599.  
  600.            (DECNRCM)
  601.          Ps = 4    4  -> Turn Off Margin Bell
  602.  
  603.          Ps = 4    5  -> No Reverse-wraparound Mode
  604.          Ps = 4    6  -> Stop Logging (normally disabled by a
  605.  
  606.            compile-time option)
  607.          Ps = 4    7  -> Use Normal Screen    Buffer
  608.  
  609.          Ps = 6    7  -> Backarrow    key (DECBKM)
  610.          Ps = 1    0 0 0  -> Don't    Send Mouse X & Y on button press
  611.  
  612.            and release.  See the section Mouse Tracking.
  613.          Ps = 1    0 0 1  -> Don't    Use Hilite Mouse Tracking
  614.  
  615.          Ps = 1    0 0 2  -> Don't    Use Cell Motion    Mouse Tracking
  616.          Ps = 1    0 0 3  -> Don't    Use All    Motion Mouse Tracking
  617.  
  618.          Ps = 1    0 4 7  -> Use Normal Screen Buffer, clearing
  619.            screen first if in the Alternate    Screen (unless disabled
  620.  
  621.            by the titeInhibit resource)
  622.          Ps = 1    0 4 8  -> Restore cursor as in DECRC (unless
  623.  
  624.            disabled    by the titeInhibit resource)
  625. CSI ? Pm r     Restore DEC Private Mode    Values.     The value of Ps previ-
  626.  
  627.            ously saved is restored.     Ps values are the same    as for
  628.            DECSET.
  629.  
  630. CSI ? Pm s     Save DEC    Private    Mode Values.  Ps values    are the    same as
  631.            for DECSET.
  632.  
  633.  
  634. OSC Ps ; Pt ST
  635.  
  636. OSC Ps ; Pt BEL    Set Text Parameters
  637.          Ps = 0     -> Change Icon    Name and Window    Title to Pt
  638.  
  639.          Ps = 1     -> Change Icon    Name to    Pt
  640.          Ps = 2     -> Change Window Title    to Pt
  641.  
  642.          Ps = 1    0  -> Change color names starting with text
  643.            foreground to Pt    (a list    of one or more color names,
  644.  
  645.            separated by semicolon, up to seven).
  646.          Ps = 1    1  -> Change colors starting with text back-
  647.  
  648.            ground to Pt
  649.          Ps = 1    2  -> Change colors starting with text cursor to
  650.  
  651.            Pt
  652.          Ps = 1    3  -> Change colors starting with mouse    fore-
  653.  
  654.            ground to Pt
  655.          Ps = 1    4  -> Change colors starting with mouse    back-
  656.  
  657.            ground to Pt
  658.          Ps = 1    5  -> Change colors starting with Tek foreground
  659.  
  660.            to Pt
  661.          Ps = 1    6  -> Change colors starting with Tek background
  662.  
  663.            to Pt
  664.          Ps = 1    7  -> Change colors starting with highlight to
  665.  
  666.            Pt
  667.          Ps = 4    6  -> Change Log File to Pt (normally disabled
  668.  
  669.            by a compile-time option)
  670.          Ps = 5    0  -> Set Font to Pt
  671.  
  672.  
  673. PM Pt ST       xterm implements    no PM functions; Pt is ignored.     Pt need
  674.  
  675.            not be printable    characters.
  676.  
  677. Mouse Tracking
  678. The VT widget can be set to send the mouse position and    other informa-
  679. tion on    button presses.     These modes are typically used    by editors and
  680. other full-screen applications that want to make use of    the mouse.
  681.  
  682. There are five mutually    exclusive modes, each enabled (or disabled) by a
  683. different parameter in the DECSET CSI ?    Pm h or    DECRST CSI ? Pm    l con-
  684. trol sequence.
  685. Manifest constants for the parameter values are    defined    in xcharmouse.h
  686. as follows:
  687. D .ft 1
  688. #define    SET_X10_MOUSE            9
  689. #define    SET_VT200_MOUSE            1000
  690. #define    SET_VT200_HIGHLIGHT_MOUSE   1001
  691. #define    SET_BTN_EVENT_MOUSE        1002
  692. #define    SET_ANY_EVENT_MOUSE        1003
  693.  
  694.  
  695. The motion reporting modes are strictly    xterm extensions, and are not
  696. part of    any standard, though they are analogous    to the DEC VT200 DECELR
  697. locator    reports.
  698. Parameters (such as pointer position and button    number)    for all    mouse
  699. tracking escape    sequences generated by xterm encode numeric parameters
  700. in a single character as value+32.  For    example, !  specifies the value
  701. 1.  The    upper left character position on the terminal is denoted as 1,1.
  702.  
  703. X10 compatibility mode sends an    escape sequence    only on    button press,
  704. encoding the location and the mouse button pressed.  It    is enabled by
  705. specifying parameter 9 to DECSET.  On button press, xterm sends    CSI M
  706. CbCxCy (6 characters).    Cb is button-1.     Cx and    Cy are the x and y coor-
  707. dinates    of the mouse when the button was pressed.
  708. Normal tracking    mode sends an escape sequence on both button press and
  709. release.  Modifier key (shift, ctrl, meta) information is also sent.  It
  710. is enabled by specifying parameter 1000    to DECSET.  On button press or
  711. release, xterm sends CSI M CbCxCy.  The    low two    bits of    Cb encode button
  712. information:  0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release.
  713. The upper bits encode the modifiers which were down when the button was
  714. pressed    and are    added together.     4=Shift, 8=Meta, 16=Control.  Cx and Cy
  715. are the    x and y    coordinates of the mouse event.     The upper left    corner
  716. is (1,1).
  717.  
  718. Mouse hilite tracking notifies a program of a button press, receives a
  719. range of lines from the    program, highlights the    region covered by the
  720. mouse within that range    until button release, and then sends the program
  721. the release coordinates.  It is    enabled    by specifying parameter    1001 to
  722. DECSET.     Highlighting is performed only    for button 1, though other but-
  723. ton events can be received.  Warning: use of this mode requires    a
  724. cooperating program or it will hang xterm.  On button press, the same
  725. information as for normal tracking is generated; xterm then waits for
  726. the program to send mouse tracking information.     All X events are
  727. ignored    until the proper escape    sequence is received from the pty:  CSI
  728. Ps ; Ps    ; Ps ; Ps ; Ps T .  The    parameters are func, startx, starty,
  729. firstrow, and lastrow.    func is    non-zero to initiate hilite tracking and
  730. zero to    abort.    startx and starty give the starting x and y location for
  731. the highlighted    region.     The ending location tracks the    mouse, but will
  732. never be above row firstrow and    will always be above row lastrow.  (The
  733. top of the screen is row 1.)  When the button is released, xterm reports
  734. the ending position one    of two ways: if    the start and end coordinates
  735. are valid text locations: CSI t    CxCy.  If either coordinate is past the
  736. end of the line:  CSI T    CxCyCxCyCxCy.  The parameters are startx,
  737. starty,    endx, endy, mousex, and    mousey.     startx, starty, endx, and endy
  738. give the starting and ending character positions of the    region.     mousex
  739. and mousey give    the location of    the mouse at button up,    which may not be
  740. over a character.
  741. Button-event tracking is essentially the same as normal    tracking, but
  742. xterm also reports button-motion events.  Motion events    are reported
  743. only if    the mouse pointer has moved to a different character cell.  It
  744. is enabled by specifying parameter 1002    to DECSET.  On button press or
  745. release, xterm sends the same codes used by normal tracking mode.  On
  746. button-motion events, xterm adds 4 to the event    code (the third    charac-
  747. ter, Cb).  The low two bits of the event code encode the button    informa-
  748. tion.  The third bit is    set to indicate    motion.     Additional bits specify
  749. modifier keys as in normal mode.  For example, motion into cell    x,y with
  750. button 1 down is reported as CSI M @ CxCy.  ( @     = 32 +    0 (button 1) +
  751. 32 (motion indicator) ).  Similarly, motion with button    3 down is
  752. reported as CSI    M B CxCy.  ( B    = 32 + 2 (button 3) + 32 (motion indica-
  753. tor) ).
  754.  
  755. Any-event mode is the same as button-event mode, except    that all motion
  756. events are reported instead of just those that enter a new character
  757. cell.  It is enabled by    specifying 1003    to DECSET.
  758.  
  759. Tektronix 4014 Mode
  760. Most of    these sequences    are standard Tektronix 4014 control sequences.
  761. Graph mode supports the    12-bit addressing of the Tektronix 4014.  The
  762. major features missing are the write-through and defocused modes.  This
  763. document does not describe the commands    used in    the various Tektronix
  764. plotting modes but does    describe the commands to switch    modes.
  765.  
  766.  
  767. BEL           Bell (Ctrl-G)
  768. BS           Backspace (Ctrl-H)
  769.  
  770. TAB           Horizontal Tab (Ctrl-I)
  771. LF           Line Feed or New    Line (Ctrl-J)
  772.  
  773. VT           Cursor up (Ctrl-K)
  774. FF           Form Feed or New    Page (Ctrl-L)
  775.  
  776. CR           Carriage    Return (Ctrl-M)
  777. ESC ETX           Switch to VT100 Mode (ESC Ctrl-C)
  778.  
  779. ESC ENQ           Return Terminal Status (ESC Ctrl-E)
  780. ESC FF           PAGE (Clear Screen) (ESC    Ctrl-L)
  781.  
  782. ESC SO           Begin 4015 APL mode (ignored by xterm) (ESC Ctrl-N)
  783. ESC SI           End 4015    APL mode (ignored by xterm) (ESC Ctrl-O)
  784.  
  785. ESC ETB           COPY (Save Tektronix Codes to file COPYyyyy-mm-
  786.            dd.hh:mm:ss) (ESC Ctrl-W)
  787.  
  788. ESC CAN           Bypass Condition    (ESC Ctrl-X)
  789. ESC SUB           GIN mode    (ESC Ctrl-Z)
  790.  
  791. ESC FS           Special Point Plot Mode (ESC Ctrl-\)
  792. ESC 8           Select Large Character Set
  793.  
  794. ESC 9           Select #2 Character Set
  795. ESC :           Select #3 Character Set
  796.  
  797. ESC ;           Select Small Character Set
  798. OSC Ps ; Pt BEL    Set Text Parameters of VT window
  799.  
  800.          Ps = 0     -> Change Icon    Name and Window    Title to Pt
  801.          Ps = 1     -> Change Icon    Name to    Pt
  802.  
  803.          Ps = 2     -> Change Window Title    to Pt
  804.          Ps = 4    6  -> Change Log File to Pt (normally disabled
  805.  
  806.            by a compile-time option)
  807. ESC `           Normal Z    Axis and Normal    (solid)    Vectors
  808.  
  809. ESC a           Normal Z    Axis and Dotted    Line Vectors
  810. ESC b           Normal Z    Axis and Dot-Dashed Vectors
  811.  
  812. ESC c           Normal Z    Axis and Short-Dashed Vectors
  813. ESC d           Normal Z    Axis and Long-Dashed Vectors
  814.  
  815. ESC h           Defocused Z Axis    and Normal (solid) Vectors
  816. ESC i           Defocused Z Axis    and Dotted Line    Vectors
  817.  
  818. ESC j           Defocused Z Axis    and Dot-Dashed Vectors
  819. ESC k           Defocused Z Axis    and Short-Dashed Vectors
  820.  
  821. ESC l           Defocused Z Axis    and Long-Dashed    Vectors
  822. ESC p           Write-Thru Mode and Normal (solid) Vectors
  823.  
  824. ESC q           Write-Thru Mode and Dotted Line Vectors
  825. ESC r           Write-Thru Mode and Dot-Dashed Vectors
  826.  
  827. ESC s           Write-Thru Mode and Short-Dashed    Vectors
  828. ESC t           Write-Thru Mode and Long-Dashed Vectors
  829.  
  830. FS           Point Plot Mode (Ctrl-\)
  831. GS           Graph Mode (Ctrl-])
  832.  
  833. RS           Incremental Plot    Mode (Ctrl-^)
  834. US           Alpha Mode (Ctrl-_)
  835.  
  836. VT52 Mode
  837.  
  838. Parameters for cursor movement are at the end of the ESC Y  escape
  839. sequence.  Each    ordinate is encoded in a single    character as value+32.
  840. For example, !    is 1.  The screen coodinate system is 0-based.
  841.  
  842. ESC A           Cursor up.
  843.  
  844. ESC B           Cursor down.
  845. ESC C           Cursor right.
  846.  
  847. ESC D           Cursor left.
  848. ESC F           Enter graphics mode.
  849.  
  850. ESC G           Exit graphics mode.
  851. ESC H           Move the    cursor to the home position.
  852.  
  853. ESC I           Reverse line feed.
  854. ESC J           Erase from the cursor to    the end    of the screen.
  855.  
  856. ESC K           Erase from the cursor to    the end    of the line.
  857. ESC Y Ps Ps    Move the    cursor to given    row and    column.
  858.  
  859. ESC Z           Identify
  860.          -> ESC     /  Z  (``I am a VT52.'')
  861.  
  862. ESC =           Enter alternate keypad mode.
  863. ESC >           Exit alternate keypad mode.
  864.  
  865. ESC <           Exit VT52 mode (Enter VT100 mode).
  866.