ESPTerm - ESP8266 terminal emulator. Branches: [master] patches, [work] next release
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
espterm-firmware/doc/espterm-xterm.html

2253 lines
114 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ESPTerm supported escape sequences overview</title>
<style type="text/css">
/* --------------------------------------------------------- */
body {
/* Verdana, - too wide */
/* Lucida Grande, - cluttered */
/* Droid Serif - ? */
/* Optima, - maybe - seems light */
/* Verdana, - large */
/* Tahoma, - not bad */
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
}
h1,h2,h3,h4 {
font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif;
margin: 0px;
line-height: 100%;
}
h3,h4 {
margin-left: 30px;
}
pre,
code,
kbd,
samp,
tt{
/* font-family:monospace,monospace; */
font-family: "Andale Mono", "Monotype.com", monospace;
font-size:1em;
padding: 0;
margin: 0;
padding: 0;
}
*.no-header {
visibility:hidden;
overflow:hidden;
float:left;
clear: both;
width: 1px;
height: 1px;
}
pre {
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* --------------------------------------------------------- */
/*
* This is a separate file rather than embedded because it allows us to
* suppress non-working CSS from IE8, etc.
*/
@media only screen and (min-width: 500px) {
body {
margin-left: 30%;
}
p,li,dd {
max-width:700px;
}
*.nav {
margin-left: -30%;
width: 28%;
position: fixed;
top: 0;
overflow: auto;
height: 100%;
}
}
@media only screen and (min-width: 784px) {
body {
margin-left: 16em;
}
*.nav {
margin-left: -16em;
width: 15em;
position: fixed;
top: 0;
overflow: auto;
height: 100%;
}
}
*.nav ul {
list-style-type: none;
padding-left: 1em;
}
*.nav-break {
margin-top: 10px;
}
*.nav-top
{
color: #FFF;
background-color: #ccc;
text-decoration:none;
text-transform:uppercase;
font-style:italic;
}
*.menu-nav ul
{
text-decoration:none;
}
/* --------------------------------------------------------- */
del {
opacity: 0.3;
text-decoration: none;
}
ins {
color: #009A5A;
text-decoration: none;
}
ins[block] {
display: block;
white-space: normal;
box-sizing: border-box;
max-width: 700px;
border: 2px solid #006666;
background: #eee;
padding: 0.3em;
margin: .5em 0;
/* copied from the man2html style */
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
color: black;
}
ins[block] p {
margin: 0;
margin-bottom: 0.3em;
}
ins[block] p:last-child {
margin-bottom: 0;
}
.nav li {
padding-bottom: 7px;
font-size: 90%;
}
</style>
</head>
<body>
<a name="top"></a><hr>
<ins block>
<p>
This page lists all control sequences of <b>xterm</b>, which <b>ESPTerm</b> uses as a reference implementation.
</p>
<p>
Features and sequences not supported by <b>ESPTerm</b> are grayed out, added text is in green color
or in gray boxes like this one.
</p>
</ins>
<p>This document was adapted from <a href="/">http://invisible-island.net/</a><a href="/xterm/">xterm/</a>.</p>
<hr>
<h1 class="no-header">ctlseqs(ms)</h1>
<pre>
<b>XTerm</b> <ins>and <b>ESPTerm</b></ins> <b>Control</b> <b>Sequences</b>
<i>Edward</i> <i>Moy</i>
University of California, Berkeley
Revised by
<i>Stephen</i> <i>Gildea</i>
X Consortium (1994)
<i>Thomas</i> <i>Dickey</i>
XFree86 Project (1996-2006)
invisible-island.net (2006-2017)
updated for XTerm Patch #329 (2017/06/11)
</pre>
<h2><a name="h2-Definitions" id="h2-Definitions">Definitions</a></h2>
<pre>
<i>c</i> The literal character <i>c</i>.
<i>C</i> A single (required) character.
<i>Ps</i> A single (usually optional) numeric parameter, composed of one of
more digits.
<i>Pm</i> A multiple numeric parameter composed of any number of single
numeric parameters, separated by ; character(s). Individual val-
ues for the parameters are listed with <i>Ps</i> .
<i>Pt</i> A text parameter composed of printable characters.
</pre>
<h2><a name="h2-Control-Bytes_-Characters_-and-Sequences" id="h2-Control-Bytes_-Characters_-and-Sequences">Control Bytes, Characters, and Sequences</a></h2>
<pre>
ECMA-48 (aka "ISO 6429") documents C1 (8-bit) and C0 (7-bit) codes.
Those are respectively codes 128 to 159 and 0 to 31. ECMA-48 avoids
referring to these codes as characters, because that term is associated
with <i>graphic</i> <i>characters</i>. Instead, it uses "bytes" and "codes", with
occasional lapses to "characters" where the meaning cannot be mistaken.
Controls (including the escape code 27) are processed once:
<b>o</b> This means that a C1 control can be mistaken for badly-formed UTF-8
when the terminal runs in UTF-8 mode because C1 controls are valid
<i>continuation</i> <i>bytes</i> of a UTF-8 encoded (multibyte) value.
<b>o</b> It is not possible to use a C1 control obtained from decoding the
UTF-8 text, because that would require reprocessing the data. Conse-
quently there is no ambiguity in the way this document uses the term
"character" to refer to bytes in a control sequence.
<ins block>
<p>ESPTerm implements 7-bit mode with full UTF-8 support enabled at all times.
C1 codes thus cannot be used with the terminal.</p>
<p>Bytes with the highest bit set (0x80-0xFF) are interpreted as part of a UTF-8
code point and if the received multi-byte sequence is invalid, they are
discarded.</p>
</ins>
The order of processing is a necessary consequence of the way ECMA-48 is
designed:
<b>o</b> Each byte sent to the terminal can be unambiguously determined to fall
into one of a few categories (C0, C1 and graphic characters).
<b>o</b> ECMA-48 is <i>modal</i>; once it starts processing a control sequence, the
terminal continues until the sequence is complete, or some byte is
found which is not allowed in the sequence.
<b>o</b> Intermediate, parameter and final bytes may use the same codes as
graphic characters, but they are processed as part of a control
sequence and are not actually graphic characters.
<del><b>o</b> Eight-bit controls can have intermediate, etc., bytes in the range 160
to 255. Those can be treated as their counterparts in the range 32 to
127.</del>
<b>o</b> Single-byte controls can be handled separately from multi-byte control
sequences because ECMA-48's rules are unambiguous.
As a special case, ECMA-48 (section 9) mentions that the control func-
tions shift-in and shift-out are allowed to occur within a 7-bit
multibyte control sequence because those cannot alter the meaning of
the control sequence.
<b>o</b> Some controls (such as OSC ) introduce a string mode, which is ended
on a ST (string terminator).
Again, the terminal should accept single-byte controls within the
string. <del>However, <i>xterm</i> has a resource setting <b>brokenLinuxOSC</b> to allow
recovery from applications which rely upon malformed palette sequences
used by the Linux console.</del>
<ins block>
<p>ESPTerm allows only graphic characters and UTF-8 in string mode commands like OSC.</p>
<p>Low ASCII control characters (< 32) are acted upon immediately on reception, with the
exception of ST and BEL, which both terminate the string and execute the command.</p>
<p>CAN and SUB cause an immediate reset of the parser, discarding any command or
sequence currently being processed.</p>
</ins>
</pre>
<h2><a name="h2-C1-_8-Bit_-Control-Characters" id="h2-C1-_8-Bit_-Control-Characters">C1 (8-Bit) Control Characters</a></h2>
<pre>
<del>The <i>xterm</i> program recognizes both 8-bit and 7-bit control characters.
It generates 7-bit controls (by default) or 8-bit if S8C1T is enabled.
The following pairs of 7-bit and 8-bit control characters are equiva-
lent:</del>
<ins block>
<p>ESPTerm supports only the 7-bit versions, eg. <code>ESC D</code>.</p>
<p>Sequences not implemented are still consumed by the parser, but have no effect,
with the exception of SOS, PM and APC, which start a string terminated by ST or BEL.
The string is discarded upon completion.</p>
</ins>
ESC D
Index (IND is 0x84).
ESC E
Next Line (NEL is 0x85).
ESC H
Tab Set (HTS is 0x88).
ESC M
Reverse Index (RI is 0x8d).
<del>ESC N
Single Shift Select of G2 Character Set (SS2 is 0x8e). This
affects next character only.</del>
<del>ESC O
Single Shift Select of G3 Character Set (SS3 is 0x8f). This
affects next character only.</del>
<del>ESC P
Device Control String (DCS is 0x90).</del>
<del>ESC V
Start of Guarded Area (SPA is 0x96).</del>
<del>ESC W
End of Guarded Area (EPA is 0x97).</del>
<del>ESC X
Start of String (SOS is 0x98).</del>
<del>ESC Z
Return Terminal ID (DECID is 0x9a). Obsolete form of CSI c (DA).</del>
ESC [
Control Sequence Introducer (CSI is 0x9b).
ESC \
String Terminator (ST is 0x9c).
ESC ]
Operating System Command (OSC is 0x9d).
<del>ESC ^
Privacy Message (PM is 0x9e).</del>
<del>ESC _
Application Program Command (APC is 0x9f).</del>
These control characters are used in the vtXXX emulation.
</pre>
<h2><a name="h2-VT100-Mode" id="h2-VT100-Mode">VT100 Mode</a></h2>
<pre>
Most of these control sequences are standard VT102 control sequences,
but there is support for later DEC VT terminals (i.e., VT220, VT320,
VT420, VT510), as well as ISO 6429 and <i>aixterm</i> color controls. The only
VT102 feature not supported is auto-repeat, since the only way X pro-
vides for this will affect all windows.
There are additional control sequences to provide <i>xterm-</i>dependent func-
tions, such as the scrollbar or window size. Where the function is
specified by DEC or ISO 6429, the code assigned to it is given in paren-
theses.
The escape codes to designate and invoke character sets are specified by
ISO 2022 (see that document for a discussion of character sets).
Many of the features are optional; <i>xterm</i> can be configured and built
without support for them.
</pre>
<h2><a name="h2-Single-character-functions" id="h2-Single-character-functions">Single-character functions</a></h2>
<pre>
BEL Bell (Ctrl-G).
BS Backspace (Ctrl-H).
CR Carriage Return (Ctrl-M).
ENQ Return Terminal Status (Ctrl-E). Default response is an empty
string, but may be overridden by a resource <b>answerbackString</b>.
FF Form Feed or New Page (NP). (FF is Ctrl-L). FF is treated
the same as LF .
LF Line Feed or New Line (NL). (LF is Ctrl-J).
SI Shift In (Ctrl-O) -&gt; Switch to Standard Character Set. This
invokes the G0 character set (the default).
SO Shift Out (Ctrl-N) -&gt; Switch to Alternate Character Set. This
invokes the G1 character set.
SP Space.
TAB Horizontal Tab (HT) (Ctrl-I).
VT Vertical Tab (Ctrl-K). This is treated the same as LF.
<ins block>
<p>ESPTerm's <b>answerbackString</b> has the form <code>SOS ESPTerm VERSION ST</code>
(SOS and ST as described in <a href="#h2-C1-_8-Bit_-Control-Characters">C1 (8-Bit) Control Characters</a>).</p>
</ins>
</pre>
<h2><a name="h2-Controls-beginning-with-ESC" id="h2-Controls-beginning-with-ESC">Controls beginning with ESC</a></h2>
<ins block>
<p>Most escape sequences that are not implemented in ESPTerm are still safely consumed and discarded by the parser.</p>
</ins>
<pre>
This excludes controls where ESC is part of a 7-bit equivalent to 8-bit
C1 controls, ordered by the final character(s).
<del>ESC SP F 7-bit controls (S7C1T).
ESC SP G 8-bit controls (S8C1T).
ESC SP L Set ANSI conformance level 1 (dpANS X3.134.1).
ESC SP M Set ANSI conformance level 2 (dpANS X3.134.1).
ESC SP N Set ANSI conformance level 3 (dpANS X3.134.1).
ESC # 3 DEC double-height line, top half (DECDHL).
ESC # 4 DEC double-height line, bottom half (DECDHL).
ESC # 5 DEC single-width line (DECSWL).
ESC # 6 DEC double-width line (DECDWL).</del>
ESC # 8 DEC Screen Alignment Test (DECALN).
<del>ESC % @ Select default character set. That is ISO 8859-1 (ISO 2022).
ESC % G Select UTF-8 character set (ISO 2022).</del>
ESC ( <i>C</i> Designate G0 Character Set (ISO 2022, VT100).
Final character <i>C</i> for designating 94-character sets. In this
list, 0 , A and B apply to VT100 and up, the remainder to
VT220 and up. The VT220 character sets, together with the
Portuguese character set are activated by the National
Replacement Character controls. The A is a special case,
since it is also activated by the VT300-control for British
Latin-1 separately from the National Replacement Character
controls.
<i>C</i> = 0 -&gt; DEC Special Character and Line Drawing Set.
<ins> <i>C</i> = 1 -&gt; Augmented DOS page 437</ins>
<del> <i>C</i> = &lt; -&gt; DEC Supplementary (VT200).
<i>C</i> = % 5 -&gt; DEC Supplementary Graphics (VT300).
<i>C</i> = &gt; -&gt; DEC Technical (VT300).</del>
<i>C</i> = A -&gt; United Kingdom (UK).
<i>C</i> = B -&gt; United States (USASCII). <ins>(default)</ins>
<del> <i>C</i> = 4 -&gt; Dutch.
<i>C</i> = C or 5 -&gt; Finnish.
<i>C</i> = R or f -&gt; French.
<i>C</i> = Q or 9 -&gt; French Canadian (VT200, VT300).
<i>C</i> = K -&gt; German.
<i>C</i> = Y -&gt; Italian.
<i>C</i> = ` , E or 6 -&gt; Norwegian/Danish.
<i>C</i> = % 6 -&gt; Portuguese (VT300).
<i>C</i> = Z -&gt; Spanish.
<i>C</i> = H or 7 -&gt; Swedish.
<i>C</i> = = -&gt; Swiss.</del>
ESC ) <i>C</i> Designate G1 Character Set (ISO 2022, VT100).
The same character sets apply as for ESC ( <i>C</i>.
<del>ESC * <i>C</i> Designate G2 Character Set (ISO 2022, VT220).
The same character sets apply as for ESC ( <i>C</i>.
ESC + <i>C</i> Designate G3 Character Set (ISO 2022, VT220).
The same character sets apply as for ESC ( <i>C</i>.
ESC - <i>C</i> Designate G1 Character Set (VT300).
The same character sets apply as for ESC ( <i>C</i>.
ESC . <i>C</i> Designate G2 Character Set (VT300).
The same character sets apply as for ESC ( <i>C</i>.
ESC / <i>C</i> Designate G3 Character Set (VT300).
These work for 96-character sets only.
<i>C</i> = A -&gt; ISO Latin-1 Supplemental.</del>
ESC 6 Back Index (DECBI), VT420 and up.
ESC 7 Save Cursor (DECSC).
ESC 8 Restore Cursor (DECRC).
ESC 9 Forward Index (DECFI), VT420 and up.
ESC = Application Keypad (DECKPAM).
ESC &gt; Normal Keypad (DECKPNM).
ESC F Cursor to lower left corner of screen. <del>This is enabled by the
<b>hpLowerleftBugCompat</b> resource.</del> <ins>This is always enabled</ins>
ESC c Full Reset (RIS).
<del>ESC l Memory Lock (per HP terminals). Locks memory above the cur-
sor.
ESC m Memory Unlock (per HP terminals).
ESC n Invoke the G2 Character Set as GL (LS2).
ESC o Invoke the G3 Character Set as GL (LS3).
ESC | Invoke the G3 Character Set as GR (LS3R).
ESC } Invoke the G2 Character Set as GR (LS2R).
ESC ~ Invoke the G1 Character Set as GR (LS1R).</del>
</pre>
<h2><a name="h2-Application-Program-Command-functions" id="h2-Application-Program-Command-functions">Application Program-Command functions</a></h2>
<pre>
APC <i>Pt</i> ST None. <i>xterm</i> implements no APC functions; <i>Pt</i> is ignored. <i>Pt</i>
need not be printable characters.
</pre>
<h2><a name="h2-Device-Control-functions" id="h2-Device-Control-functions">Device-Control functions</a></h2>
<pre>
<del>DCS <i>Ps</i>; <i>Ps</i>| <i>Pt</i> ST
User-Defined Keys (DECUDK). The first parameter:
<i>Ps</i> = 0 -&gt; Clear all UDK definitions before starting
(default).
<i>Ps</i> = 1 -&gt; Erase Below (default).
The second parameter:
<i>Ps</i> = 0 &lt;- Lock the keys (default).
<i>Ps</i> = 1 &lt;- Do not lock.
The third parameter is a ';'-separated list of strings denot-
ing the key-code separated by a '/' from the hex-encoded key
value. The key codes correspond to the DEC function-key codes
(e.g., F6=17).</del>
DCS $ q <i>Pt</i> ST
Request Status String (DECRQSS). The string following the "q"
is one of the following:
" q -&gt; DECSCA
" p -&gt; DECSCL
r -&gt; DECSTBM
s -&gt; DECSLRM
m -&gt; SGR
SP q -&gt; DECSCUSR
<i>xterm</i> responds with DCS 1 $ r <i>Pt</i> ST for valid requests,
replacing the <i>Pt</i> with the corresponding CSI string, or DCS 0 $
r <i>Pt</i> ST for invalid requests.
<del>DCS + p <i>Pt</i> ST
Set Termcap/Terminfo Data (xterm, experimental). The string
following the "p" is a name to use for retrieving data from
the terminal database. The data will be used for the "tcap"
keyboard configuration's function- and special-keys, as well
as by the Request Termcap/Terminfo String control.
DCS + q <i>Pt</i> ST
Request Termcap/Terminfo String (xterm, experimental). The
string following the "q" is a list of names encoded in hexa-
decimal (2 digits per character) separated by ; which corre-
spond to termcap or terminfo key names.
Two special features are also recognized, which are not key
names: <i>Co</i> for termcap colors (or <i>colors</i> for terminfo colors),
and <i>TN</i> for termcap name (or <i>name</i> for terminfo name).
<i>xterm</i> responds with DCS 1 + r <i>Pt</i> ST for valid requests, adding
to <i>Pt</i> an = , and the value of the corresponding string that
<i>xterm</i> would send, or DCS 0 + r <i>Pt</i> ST for invalid requests.
The strings are encoded in hexadecimal (2 digits per charac-
ter).</del>
</pre>
<h2><a name="h2-Functions-using-CSI-_-ordered-by-the-final-character_s_" id="h2-Functions-using-CSI-_-ordered-by-the-final-character_s_">Functions using CSI , ordered by the final character(s)</a></h2>
<pre>
CSI <i>Ps</i> @ Insert <i>Ps</i> (Blank) Character(s) (default = 1) (ICH).
CSI <i>Ps</i> A Cursor Up <i>Ps</i> Times (default = 1) (CUU).
CSI <i>Ps</i> B Cursor Down <i>Ps</i> Times (default = 1) (CUD).
CSI <i>Ps</i> C Cursor Forward <i>Ps</i> Times (default = 1) (CUF).
CSI <i>Ps</i> D Cursor Backward <i>Ps</i> Times (default = 1) (CUB).
CSI <i>Ps</i> E Cursor Next Line <i>Ps</i> Times (default = 1) (CNL).
CSI <i>Ps</i> F Cursor Preceding Line <i>Ps</i> Times (default = 1) (CPL).
CSI <i>Ps</i> G Cursor Character Absolute [column] (default = [row,1]) (CHA).
CSI <i>Ps</i> ; <i>Ps</i> H
Cursor Position [row;column] (default = [1,1]) (CUP).
CSI <i>Ps</i> I Cursor Forward Tabulation <i>Ps</i> tab stops (default = 1) (CHT).
CSI <i>Ps</i> J Erase in Display (ED).
<i>Ps</i> = 0 -&gt; Erase Below (default).
<i>Ps</i> = 1 -&gt; Erase Above.
<i>Ps</i> = 2 -&gt; Erase All.
<i>Ps</i> = 3 -&gt; Erase Saved Lines (xterm).
CSI ? <i>Ps</i> J
Erase in Display (DECSED).
<i>Ps</i> = 0 -&gt; Selective Erase Below (default).
<i>Ps</i> = 1 -&gt; Selective Erase Above.
<i>Ps</i> = 2 -&gt; Selective Erase All.
<i>Ps</i> = 3 -&gt; Selective Erase Saved Lines (xterm).
CSI <i>Ps</i> K Erase in Line (EL).
<i>Ps</i> = 0 -&gt; Erase to Right (default).
<i>Ps</i> = 1 -&gt; Erase to Left.
<i>Ps</i> = 2 -&gt; Erase All.
CSI ? <i>Ps</i> K
Erase in Line (DECSEL).
<i>Ps</i> = 0 -&gt; Selective Erase to Right (default).
<i>Ps</i> = 1 -&gt; Selective Erase to Left.
<i>Ps</i> = 2 -&gt; Selective Erase All.
CSI <i>Ps</i> L Insert <i>Ps</i> Line(s) (default = 1) (IL).
CSI <i>Ps</i> M Delete <i>Ps</i> Line(s) (default = 1) (DL).
CSI <i>Ps</i> P Delete <i>Ps</i> Character(s) (default = 1) (DCH).
CSI <i>Ps</i> S Scroll up <i>Ps</i> lines (default = 1) (SU).
<del>CSI ? <i>Pi</i>; <i>Pa</i>; <i>Pv</i> S
If configured to support either <b>Sixel</b> <b>Graphics</b> or <b>ReGIS</b> <b>Graph-</b>
<b>ics</b>, <i>xterm</i> accepts a three-parameter control sequence, where
<i>Pi</i>, <i>Pa</i> and <i>Pv</i> are the <i>item</i>, <i>action</i> and <i>value</i>:
<i>Pi</i> = 1 -&gt; item is number of color registers.
<i>Pi</i> = 2 -&gt; item is Sixel graphics geometry (in pixels).
<i>Pi</i> = 3 -&gt; item is ReGIS graphics geometry (in pixels).
<i>Pa</i> = 1 -&gt; read
<i>Pa</i> = 2 -&gt; reset to default
<i>Pa</i> = 3 -&gt; set to value in <i>Pv</i>
<i>Pa</i> = 4 -&gt; read the maximum allowed value
<i>Pv</i> can be omitted except when setting (<i>Pa</i> == 3 ).
<i>Pv</i> = <i>n</i> &lt;- A single integer is used for color registers.
<i>Pv</i> = <i>width</i>; <i>height</i> &lt;- Two integers for graphics geometry.
<i>xterm</i> replies with a control sequence of the same form:
CSI ? <i>Pi</i>; <i>Ps</i>; <i>Pv</i> S
where <i>Ps</i> is the status:
<i>Ps</i> = 0 -&gt; success.
<i>Ps</i> = 1 -&gt; error in <i>Pi</i>.
<i>Ps</i> = 2 -&gt; error in <i>Pa</i>.
<i>Ps</i> = 3 -&gt; failure.
On success, <i>Pv</i> represents the value read or set.
<b>Notes</b>:
<b>o</b> The current implementation allows reading the graphics
sizes, but disallows modifying those sizes because that is
done once, using resource-values.
<b>o</b> Graphics geometry is not necessarily the same as "window
size" (see the dtterm window manipulation extensions). For
example, <i>xterm</i> limits the maximum graphics geometry at com-
pile time (1000x1000 as of version 328) although the window
size can be larger.
<b>o</b> While resizing a window will always change the current
graphics geometry, the reverse is not true. Setting graph-
ics geometry does not affect the window size.</del>
CSI <i>Ps</i> T Scroll down <i>Ps</i> lines (default = 1) (SD).
<del>CSI <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> T
Initiate highlight mouse tracking. Parameters are
[func;startx;starty;firstrow;lastrow]. See the section <b>Mouse</b>
<b>Tracking</b>.</del>
<del>CSI &gt; <i>Ps</i>; <i>Ps</i> T
Reset one or more features of the title modes to the default
value. Normally, "reset" disables the feature. It is possi-
ble to disable the ability to reset features by compiling a
different default for the title modes into <i>xterm</i>.
<i>Ps</i> = 0 -&gt; Do not set window/icon labels using hexadecimal.
<i>Ps</i> = 1 -&gt; Do not query window/icon labels using hexadeci-
mal.
<i>Ps</i> = 2 -&gt; Do not set window/icon labels using UTF-8.
<i>Ps</i> = 3 -&gt; Do not query window/icon labels using UTF-8.
(See discussion of "Title Modes").</del>
CSI <i>Ps</i> X Erase <i>Ps</i> Character(s) (default = 1) (ECH).
CSI <i>Ps</i> Z Cursor Backward Tabulation <i>Ps</i> tab stops (default = 1) (CBT).
CSI <i>Pm</i> ` Character Position Absolute [column] (default = [row,1])
(HPA).
CSI <i>Pm</i> a Character Position Relative [columns] (default = [row,col+1])
(HPR).
<del>CSI <i>Ps</i> b Repeat the preceding graphic character <i>Ps</i> times (REP).</del>
CSI <i>Ps</i> c Send Device Attributes (Primary DA).
<i>Ps</i> = 0 or omitted -&gt; request attributes from terminal. The
response depends on the <b>decTerminalID</b> resource setting.
-&gt; CSI ? 1 ; 2 c ("VT100 with Advanced Video Option")
-&gt; CSI ? 1 ; 0 c ("VT101 with No Options")
-&gt; CSI ? 6 c ("VT102")
-&gt; CSI ? 6 2 ; <i>Ps</i>c ("VT220")
-&gt; CSI ? 6 3 ; <i>Ps</i>c ("VT320")
-&gt; CSI ? 6 4 ; <i>Ps</i>c ("VT420")
The VT100-style response parameters do not mean anything by
themselves. VT220 (and higher) parameters do, telling the
host what features the terminal supports:
<i>Ps</i> = 1 -&gt; 132-columns.
<i>Ps</i> = 2 -&gt; Printer.
<i>Ps</i> = 3 -&gt; ReGIS graphics.
<i>Ps</i> = 4 -&gt; Sixel graphics.
<i>Ps</i> = 6 -&gt; Selective erase.
<i>Ps</i> = 8 -&gt; User-defined keys.
<i>Ps</i> = 9 -&gt; National Replacement Character sets.
<i>Ps</i> = 1 5 -&gt; Technical characters.
<i>Ps</i> = 1 8 -&gt; User windows.
<i>Ps</i> = 2 1 -&gt; Horizontal scrolling.
<i>Ps</i> = 2 2 -&gt; ANSI color, e.g., VT525.
<i>Ps</i> = 2 9 -&gt; ANSI text locator (i.e., DEC Locator mode).
<ins block>ESPTerm identifies itself as a VT420 with national character sets.</ins><!--
-->CSI &gt; <i>Ps</i> c
Send Device Attributes (Secondary DA).
<i>Ps</i> = 0 or omitted -&gt; request the terminal's identification
code. The response depends on the <b>decTerminalID</b> resource set-
ting. It should apply only to VT220 and up, but <i>xterm</i> extends
this to VT100.
-&gt; CSI &gt; <i>Pp</i> ; <i>Pv</i> ; <i>Pc</i> c
where <i>Pp</i> denotes the terminal type
<i>Pp</i> = 0 -&gt; "VT100".
<i>Pp</i> = 1 -&gt; "VT220".
<i>Pp</i> = 2 -&gt; "VT240".
<i>Pp</i> = 1 8 -&gt; "VT330".
<i>Pp</i> = 1 9 -&gt; "VT340".
<i>Pp</i> = 2 4 -&gt; "VT320".
<i>Pp</i> = 4 1 -&gt; "VT420".
<i>Pp</i> = 6 1 -&gt; "VT510".
<i>Pp</i> = 6 4 -&gt; "VT520".
<i>Pp</i> = 6 5 -&gt; "VT525".
and <i>Pv</i> is the firmware version (for <i>xterm</i>, this was originally
the XFree86 patch number, starting with 95). <ins>For ESPTerm, this is the
firmware version expressed as integer.</ins> In a DEC termi-nal, <i>Pc</i>
indicates the ROM cartridge registration number and is always zero.
CSI <i>Pm</i> d Line Position Absolute [row] (default = [1,column]) (VPA).
CSI <i>Pm</i> e Line Position Relative [rows] (default = [row+1,column])
(VPR).
CSI <i>Ps</i> ; <i>Ps</i> f
Horizontal and Vertical Position [row;column] (default =
[1,1]) (HVP). <ins>This is functionally identical to <code>CSI Ps ; Ps H</ins>.
CSI <i>Ps</i> g Tab Clear (TBC).
<i>Ps</i> = 0 -&gt; Clear Current Column (default).
<i>Ps</i> = 3 -&gt; Clear All.
CSI <i>Pm</i> h Set Mode (SM).
<del><i>Ps</i> = 2 -&gt; Keyboard Action Mode (AM).</del>
<i>Ps</i> = 4 -&gt; Insert Mode (IRM).
<del><i>Ps</i> = 1 2 -&gt; Send/receive (SRM).</del>
<i>Ps</i> = 2 0 -&gt; Automatic Newline (LNM).
CSI ? <i>Pm</i> h
DEC Private Mode Set (DECSET).
<i>Ps</i> = 1 -&gt; Application Cursor Keys (DECCKM).
<i>Ps</i> = 2 -&gt; Designate USASCII for character sets G0-G3
(DECANM), <del>and set VT100 mode.</del>
<del><i>Ps</i> = 3 -&gt; 132 Column Mode (DECCOLM).</del>
<del><i>Ps</i> = 4 -&gt; Smooth (Slow) Scroll (DECSCLM).</del>
<i>Ps</i> = 5 -&gt; Reverse Video (DECSCNM).
<i>Ps</i> = 6 -&gt; Origin Mode (DECOM). <ins><b>TODO implement</b></ins>
<i>Ps</i> = 7 -&gt; Wraparound Mode (DECAWM).
<del><i>Ps</i> = 8 -&gt; Auto-repeat Keys (DECARM).</del>
<del><i>Ps</i> = 9 -&gt; Send Mouse X &amp; Y on button press. See the sec-
tion <b>Mouse</b> <b>Tracking</b>. This is the X10 xterm mouse protocol.</del>
<del><i>Ps</i> = 1 0 -&gt; Show toolbar (rxvt).</del>
<del><i>Ps</i> = 1 2 -&gt; Start Blinking Cursor (att610).</del>
<del><i>Ps</i> = 1 8 -&gt; Print form feed (DECPFF).</del>
<del><i>Ps</i> = 1 9 -&gt; Set print extent to full screen (DECPEX).</del>
<i>Ps</i> = 2 5 -&gt; Show Cursor (DECTCEM).
<del><i>Ps</i> = 3 0 -&gt; Show scrollbar (rxvt).</del>
<del><i>Ps</i> = 3 5 -&gt; Enable font-shifting functions (rxvt).</del>
<del><i>Ps</i> = 3 8 -&gt; Enter Tektronix Mode (DECTEK).</del>
<del><i>Ps</i> = 4 0 -&gt; Allow 80 <b>-&gt;</b> 132 Mode.</del>
<del><i>Ps</i> = 4 1 -&gt; <b>more(1)</b> fix (see <b>curses</b> resource).</del>
<del><i>Ps</i> = 4 2 -&gt; Enable National Replacement Character sets
(DECNRCM).</del>
<del><i>Ps</i> = 4 4 -&gt; Turn On Margin Bell.</del>
<del><i>Ps</i> = 4 5 -&gt; Reverse-wraparound Mode.</del>
<del><i>Ps</i> = 4 6 -&gt; Start Logging. This is normally disabled by a
compile-time option.</del>
<i>Ps</i> = 4 7 -&gt; Use Alternate Screen Buffer. <del>(This may be dis-
abled by the <b>titeInhibit</b> resource).</del> <ins>(See 1047 below for more info)</ins>
<i>Ps</i> = 6 6 -&gt; Application keypad (DECNKM).
<del><i>Ps</i> = 6 7 -&gt; Backarrow key sends backspace (DECBKM).</del>
<del><i>Ps</i> = 6 9 -&gt; Enable left and right margin mode (DECLRMM),
VT420 and up.</del>
<del><i>Ps</i> = 9 5 -&gt; Do not clear screen when DECCOLM is set/reset
(DECNCSM), VT510 and up.</del>
<del><i>Ps</i> = 1 0 0 0 -&gt; Send Mouse X &amp; Y on button press and
release. See the section <b>Mouse</b> <b>Tracking</b>. This is the X11
xterm mouse protocol.
<i>Ps</i> = 1 0 0 1 -&gt; Use Hilite Mouse Tracking.
<i>Ps</i> = 1 0 0 2 -&gt; Use Cell Motion Mouse Tracking.
<i>Ps</i> = 1 0 0 3 -&gt; Use All Motion Mouse Tracking.
<i>Ps</i> = 1 0 0 4 -&gt; Send FocusIn/FocusOut events.
<i>Ps</i> = 1 0 0 5 -&gt; Enable UTF-8 Mouse Mode.
<i>Ps</i> = 1 0 0 6 -&gt; Enable SGR Mouse Mode.
<i>Ps</i> = 1 0 0 7 -&gt; Enable Alternate Scroll Mode, i.e., the
<b>alternateScroll</b> resource.
<i>Ps</i> = 1 0 1 0 -&gt; Scroll to bottom on tty output (rxvt).
<i>Ps</i> = 1 0 1 1 -&gt; Scroll to bottom on key press (rxvt).
<i>Ps</i> = 1 0 1 5 -&gt; Enable urxvt Mouse Mode.
<i>Ps</i> = 1 0 3 4 -&gt; Interpret "meta" key, sets eighth bit.
(enables the <b>eightBitInput</b> resource).
<i>Ps</i> = 1 0 3 5 -&gt; Enable special modifiers for Alt and Num-
Lock keys. (This enables the <b>numLock</b> resource).
<i>Ps</i> = 1 0 3 6 -&gt; Send ESC when Meta modifies a key. (This
enables the <b>metaSendsEscape</b> resource).
<i>Ps</i> = 1 0 3 7 -&gt; Send DEL from the editing-keypad Delete
key.
<i>Ps</i> = 1 0 3 9 -&gt; Send ESC when Alt modifies a key. (This
enables the <b>altSendsEscape</b> resource).
<i>Ps</i> = 1 0 4 0 -&gt; Keep selection even if not highlighted.
(This enables the <b>keepSelection</b> resource).
<i>Ps</i> = 1 0 4 1 -&gt; Use the CLIPBOARD selection. (This enables
the <b>selectToClipboard</b> resource).
<i>Ps</i> = 1 0 4 2 -&gt; Enable Urgency window manager hint when
Control-G is received. (This enables the <b>bellIsUrgent</b>
resource).
<i>Ps</i> = 1 0 4 3 -&gt; Enable raising of the window when Control-G
is received. (enables the <b>popOnBell</b> resource).
<i>Ps</i> = 1 0 4 4 -&gt; Reuse the most recent data copied to CLIP-
BOARD. (This enables the <b>keepClipboard</b> resource).</del>
<a name="SET1047"></a><i>Ps</i> = 1 0 4 7 -&gt; Use Alternate Screen Buffer. (This may be
disabled by the <b>titeInhibit</b> resource).
<i>Ps</i> = 1 0 4 8 -&gt; Save cursor as in DECSC. (This may be dis-
abled by the <b>titeInhibit</b> resource).
<i>Ps</i> = 1 0 4 9 -&gt; Save cursor as in DECSC and use Alternate
Screen Buffer, clearing it first. <del>(This may be disabled by
the <b>titeInhibit</b> resource).</del> This combines the effects of the 1
0 4 7 and 1 0 4 8 modes. Use this with terminfo-based
applications rather than the 4 7 mode.
<ins block>ESP8266 doesn't have enough RAM to hold two screen buffers.
Instead, we at least back up and restore screen title, size and other
attributes. The screen is also cleared with each buffer change. <b>TODO implement</b></ins><!--
--> <del><i>Ps</i> = 1 0 5 0 -&gt; Set terminfo/termcap function-key mode.
<i>Ps</i> = 1 0 5 1 -&gt; Set Sun function-key mode.
<i>Ps</i> = 1 0 5 2 -&gt; Set HP function-key mode.
<i>Ps</i> = 1 0 5 3 -&gt; Set SCO function-key mode.
<i>Ps</i> = 1 0 6 0 -&gt; Set legacy keyboard emulation (X11R6).
<i>Ps</i> = 1 0 6 1 -&gt; Set VT220 keyboard emulation.
<i>Ps</i> = 2 0 0 4 -&gt; Set bracketed paste mode.</del>
<del>CSI <i>Pm</i> i Media Copy (MC).
<i>Ps</i> = 0 -&gt; Print screen (default).
<i>Ps</i> = 4 -&gt; Turn off printer controller mode.
<i>Ps</i> = 5 -&gt; Turn on printer controller mode.
<i>Ps</i> = 1 0 -&gt; HTML screen dump.
<i>Ps</i> = 1 1 -&gt; SVG screen dump.
CSI ? <i>Pm</i> i
Media Copy (MC, DEC-specific).
<i>Ps</i> = 1 -&gt; Print line containing cursor.
<i>Ps</i> = 4 -&gt; Turn off autoprint mode.
<i>Ps</i> = 5 -&gt; Turn on autoprint mode.
<i>Ps</i> = 1 0 -&gt; Print composed display, ignores DECPEX.
<i>Ps</i> = 1 1 -&gt; Print all pages.</del>
CSI <i>Pm</i> l Reset Mode (RM). <ins>See SM above.</ins>
<!-- <i>Ps</i> = 2 -&gt; Keyboard Action Mode (AM).
<i>Ps</i> = 4 -&gt; Replace Mode (IRM).
<i>Ps</i> = 1 2 -&gt; Send/receive (SRM).
<i>Ps</i> = 2 0 -&gt; Normal Linefeed (LNM).-->
CSI ? <i>Pm</i> l
DEC Private Mode Reset (DECRST). <ins>See DECSET above.</ins>
<!-- <i>Ps</i> = 1 -&gt; Normal Cursor Keys (DECCKM).
<i>Ps</i> = 2 -&gt; Designate VT52 mode (DECANM).
<i>Ps</i> = 3 -&gt; 80 Column Mode (DECCOLM).
<i>Ps</i> = 4 -&gt; Jump (Fast) Scroll (DECSCLM).
<i>Ps</i> = 5 -&gt; Normal Video (DECSCNM).
<i>Ps</i> = 6 -&gt; Normal Cursor Mode (DECOM).
<i>Ps</i> = 7 -&gt; No Wraparound Mode (DECAWM).
<i>Ps</i> = 8 -&gt; No Auto-repeat Keys (DECARM).
<i>Ps</i> = 9 -&gt; Don't send Mouse X &amp; Y on button press.
<i>Ps</i> = 1 0 -&gt; Hide toolbar (rxvt).
<i>Ps</i> = 1 2 -&gt; Stop Blinking Cursor (att610).
<i>Ps</i> = 1 8 -&gt; Don't print form feed (DECPFF).
<i>Ps</i> = 1 9 -&gt; Limit print to scrolling region (DECPEX).
<i>Ps</i> = 2 5 -&gt; Hide Cursor (DECTCEM).
<i>Ps</i> = 3 0 -&gt; Don't show scrollbar (rxvt).
<i>Ps</i> = 3 5 -&gt; Disable font-shifting functions (rxvt).
<i>Ps</i> = 4 0 -&gt; Disallow 80 <b>-&gt;</b> 132 Mode.
<i>Ps</i> = 4 1 -&gt; No <b>more(1)</b> fix (see <b>curses</b> resource).
<i>Ps</i> = 4 2 -&gt; Disable National Replacement Character sets
(DECNRCM).
<i>Ps</i> = 4 4 -&gt; Turn Off Margin Bell.
<i>Ps</i> = 4 5 -&gt; No Reverse-wraparound Mode.
<i>Ps</i> = 4 6 -&gt; Stop Logging. (This is normally disabled by a
compile-time option).
<i>Ps</i> = 4 7 -&gt; Use Normal Screen Buffer.
<i>Ps</i> = 6 6 -&gt; Numeric keypad (DECNKM).
<i>Ps</i> = 6 7 -&gt; Backarrow key sends delete (DECBKM).
<i>Ps</i> = 6 9 -&gt; Disable left and right margin mode (DECLRMM),
VT420 and up.
<i>Ps</i> = 9 5 -&gt; Clear screen when DECCOLM is set/reset (DEC-
NCSM), VT510 and up.
<i>Ps</i> = 1 0 0 0 -&gt; Don't send Mouse X &amp; Y on button press and
release. See the section <b>Mouse</b> <b>Tracking</b>.
<i>Ps</i> = 1 0 0 1 -&gt; Don't use Hilite Mouse Tracking.
<i>Ps</i> = 1 0 0 2 -&gt; Don't use Cell Motion Mouse Tracking.
<i>Ps</i> = 1 0 0 3 -&gt; Don't use All Motion Mouse Tracking.
<i>Ps</i> = 1 0 0 4 -&gt; Don't send FocusIn/FocusOut events.
<i>Ps</i> = 1 0 0 5 -&gt; Disable UTF-8 Mouse Mode.
<i>Ps</i> = 1 0 0 6 -&gt; Disable SGR Mouse Mode.
<i>Ps</i> = 1 0 0 7 -&gt; Disable Alternate Scroll Mode, i.e., the
<b>alternateScroll</b> resource.
<i>Ps</i> = 1 0 1 0 -&gt; Don't scroll to bottom on tty output
(rxvt).
<i>Ps</i> = 1 0 1 1 -&gt; Don't scroll to bottom on key press (rxvt).
<i>Ps</i> = 1 0 1 5 -&gt; Disable urxvt Mouse Mode.
<i>Ps</i> = 1 0 3 4 -&gt; Don't interpret "meta" key. (This disables
the <b>eightBitInput</b> resource).
<i>Ps</i> = 1 0 3 5 -&gt; Disable special modifiers for Alt and Num-
Lock keys. (This disables the <b>numLock</b> resource).
<i>Ps</i> = 1 0 3 6 -&gt; Don't send ESC when Meta modifies a key.
(This disables the <b>metaSendsEscape</b> resource).
<i>Ps</i> = 1 0 3 7 -&gt; Send VT220 Remove from the editing-keypad
Delete key.
<i>Ps</i> = 1 0 3 9 -&gt; Don't send ESC when Alt modifies a key.
(This disables the <b>altSendsEscape</b> resource).
<i>Ps</i> = 1 0 4 0 -&gt; Do not keep selection when not highlighted.
(This disables the <b>keepSelection</b> resource).
<i>Ps</i> = 1 0 4 1 -&gt; Use the PRIMARY selection. (This disables
the <b>selectToClipboard</b> resource).
<i>Ps</i> = 1 0 4 2 -&gt; Disable Urgency window manager hint when
Control-G is received. (This disables the <b>bellIsUrgent</b>
resource).
<i>Ps</i> = 1 0 4 3 -&gt; Disable raising of the window when Control-
G is received. (This disables the <b>popOnBell</b> resource).
<i>Ps</i> = 1 0 4 7 -&gt; Use Normal Screen Buffer, clearing screen
first if in the Alternate Screen. (This may be disabled by
the <b>titeInhibit</b> resource).
<i>Ps</i> = 1 0 4 8 -&gt; Restore cursor as in DECRC. (This may be
disabled by the <b>titeInhibit</b> resource).
<i>Ps</i> = 1 0 4 9 -&gt; Use Normal Screen Buffer and restore cursor
as in DECRC. (This may be disabled by the <b>titeInhibit</b>
resource). This combines the effects of the 1 0 4 7 and 1 0
4 8 modes. Use this with terminfo-based applications rather
than the 4 7 mode.
<i>Ps</i> = 1 0 5 0 -&gt; Reset terminfo/termcap function-key mode.
<i>Ps</i> = 1 0 5 1 -&gt; Reset Sun function-key mode.
<i>Ps</i> = 1 0 5 2 -&gt; Reset HP function-key mode.
<i>Ps</i> = 1 0 5 3 -&gt; Reset SCO function-key mode.
<i>Ps</i> = 1 0 6 0 -&gt; Reset legacy keyboard emulation (X11R6).
<i>Ps</i> = 1 0 6 1 -&gt; Reset keyboard emulation to Sun/PC style.
<i>Ps</i> = 2 0 0 4 -&gt; Reset bracketed paste mode.-->
CSI <i>Pm</i> m Character Attributes (SGR).
<i>Ps</i> = 0 -&gt; Normal (default).
<i>Ps</i> = 1 -&gt; Bold.
<i>Ps</i> = 2 -&gt; Faint, decreased intensity (ISO 6429).
<i>Ps</i> = 3 -&gt; Italicized (ISO 6429).
<i>Ps</i> = 4 -&gt; Underlined.
<i>Ps</i> = 5 -&gt; Blink <span>(appears as Bold).</span>
<i>Ps</i> = 7 -&gt; Inverse.
<del><i>Ps</i> = 8 -&gt; Invisible, i.e., hidden (VT300).</del>
<i>Ps</i> = 9 -&gt; Crossed-out characters (ISO 6429).
<ins><i>Ps</i> = 2 0 -&gt; Fraktur (code from Wikipedia)</ins>
<del><i>Ps</i> = 2 1 -&gt; Doubly-underlined (ISO 6429).</del>
<ins><i>Ps</i> = 2 1 -&gt; Bold: off</ins>
<i>Ps</i> = 2 2 -&gt; Normal (neither bold nor faint).
<i>Ps</i> = 2 3 -&gt; Not italicized <ins>or Fraktur</ins> (ISO 6429).
<i>Ps</i> = 2 4 -&gt; Not underlined.
<i>Ps</i> = 2 5 -&gt; Steady (not blinking).
<i>Ps</i> = 2 7 -&gt; Positive (not inverse).
<del><i>Ps</i> = 2 8 -&gt; Visible, i.e., not hidden (VT300).</del>
<i>Ps</i> = 2 9 -&gt; Not crossed-out (ISO 6429).
<i>Ps</i> = 3 0 -&gt; Set foreground color to Black.
<i>Ps</i> = 3 1 -&gt; Set foreground color to Red.
<i>Ps</i> = 3 2 -&gt; Set foreground color to Green.
<i>Ps</i> = 3 3 -&gt; Set foreground color to Yellow.
<i>Ps</i> = 3 4 -&gt; Set foreground color to Blue.
<i>Ps</i> = 3 5 -&gt; Set foreground color to Magenta.
<i>Ps</i> = 3 6 -&gt; Set foreground color to Cyan.
<i>Ps</i> = 3 7 -&gt; Set foreground color to White. <ins>= light gray</ins>
<i>Ps</i> = 3 9 -&gt; Set foreground color to default (original).
<i>Ps</i> = 4 0 -&gt; Set background color to Black.
<i>Ps</i> = 4 1 -&gt; Set background color to Red.
<i>Ps</i> = 4 2 -&gt; Set background color to Green.
<i>Ps</i> = 4 3 -&gt; Set background color to Yellow.
<i>Ps</i> = 4 4 -&gt; Set background color to Blue.
<i>Ps</i> = 4 5 -&gt; Set background color to Magenta.
<i>Ps</i> = 4 6 -&gt; Set background color to Cyan.
<i>Ps</i> = 4 7 -&gt; Set background color to White.
<i>Ps</i> = 4 9 -&gt; Set background color to default (original).
<del>If 16-color support is compiled, the following apply. Assume
that <i>xterm</i>'s resources are set so that the ISO color codes are
the first 8 of a set of 16. Then the <i>aixterm</i> colors are the
bright versions of the ISO colors:</del>
<ins block>Codes 90-97 and 100-107 produce brighter versions of the base colors.</ins><!--
--> <i>Ps</i> = 9 0 -&gt; Set foreground color to Black. <ins>= dark gray</ins>
<i>Ps</i> = 9 1 -&gt; Set foreground color to Red.
<i>Ps</i> = 9 2 -&gt; Set foreground color to Green.
<i>Ps</i> = 9 3 -&gt; Set foreground color to Yellow.
<i>Ps</i> = 9 4 -&gt; Set foreground color to Blue.
<i>Ps</i> = 9 5 -&gt; Set foreground color to Magenta.
<i>Ps</i> = 9 6 -&gt; Set foreground color to Cyan.
<i>Ps</i> = 9 7 -&gt; Set foreground color to White.
<i>Ps</i> = 1 0 0 -&gt; Set background color to Black.
<i>Ps</i> = 1 0 1 -&gt; Set background color to Red.
<i>Ps</i> = 1 0 2 -&gt; Set background color to Green.
<i>Ps</i> = 1 0 3 -&gt; Set background color to Yellow.
<i>Ps</i> = 1 0 4 -&gt; Set background color to Blue.
<i>Ps</i> = 1 0 5 -&gt; Set background color to Magenta.
<i>Ps</i> = 1 0 6 -&gt; Set background color to Cyan.
<i>Ps</i> = 1 0 7 -&gt; Set background color to White.
<del>If <i>xterm</i> is compiled with the 16-color support disabled, it
supports the following, from <i>rxvt</i>:
<i>Ps</i> = 1 0 0 -&gt; Set foreground and background color to
default.
<i>Xterm</i> maintains a color palette whose entries are identified
by an index beginning with zero. If 88- or 256-color support
is compiled, the following apply:
<b>o</b> All parameters are decimal integers.
<b>o</b> RGB values range from zero (0) to 255.
<b>o</b> ISO-8613-3 can be interpreted in more than one way; <i>xterm</i>
allows the semicolons in this control to be replaced by
colons (but after the first colon, colons must be used).
These ISO-8613-3 controls are supported:
<i>Pm</i> = 3 8 ; 2 ; <i>Pr</i>; <i>Pg</i>; <i>Pb</i> -&gt; Set foreground color to the
closest match in <i>xterm</i>'s palette for the given RGB <i>Pr</i>/<i>Pg</i>/<i>Pb</i>.
<i>Pm</i> = 3 8 ; 5 ; <i>Ps</i> -&gt; Set foreground color to <i>Ps</i>.
<i>Pm</i> = 4 8 ; 2 ; <i>Pr</i>; <i>Pg</i>; <i>Pb</i> -&gt; Set background color to the
closest match in <i>xterm</i>'s palette for the given RGB <i>Pr</i>/<i>Pg</i>/<i>Pb</i>.
<i>Pm</i> = 4 8 ; 5 ; <i>Ps</i> -&gt; Set background color to <i>Ps</i>.</del>
<del>CSI &gt; <i>Ps</i>; <i>Ps</i> m
Set or reset resource-values used by <i>xterm</i> to decide whether
to construct escape sequences holding information about the
modifiers pressed with a given key. The first parameter iden-
tifies the resource to set/reset. The second parameter is the
value to assign to the resource. If the second parameter is
omitted, the resource is reset to its initial value.
<i>Ps</i> = 0 -&gt; modifyKeyboard.
<i>Ps</i> = 1 -&gt; modifyCursorKeys.
<i>Ps</i> = 2 -&gt; modifyFunctionKeys.
<i>Ps</i> = 4 -&gt; modifyOtherKeys.
If no parameters are given, all resources are reset to their
initial values.</del>
CSI <i>Ps</i> n Device Status Report (DSR).
<i>Ps</i> = 5 -&gt; Status Report.
Result ("OK") is CSI 0 n
<i>Ps</i> = 6 -&gt; Report Cursor Position (CPR) [row;column].
Result is CSI <i>r</i> ; <i>c</i> R
<del><b>Note</b>: it is possible for this sequence to be sent by a func-
tion key. For example, with the default keyboard configura-
tion the shifted F1 key may send (with shift-, control-, alt-
modifiers)
CSI 1 ; 2 R , or
CSI 1 ; 5 R , or
CSI 1 ; 6 R , etc.
The second parameter encodes the modifiers; values range from
2 to 16. See the section <b>PC-Style</b> <b>Function</b> <b>Keys</b> for the
codes. The <b>modifyFunctionKeys</b> and <b>modifyKeyboard</b> resources
can change the form of the string sent from the modified F1
key.</del>
<del>CSI &gt; <i>Ps</i> n
Disable modifiers which may be enabled via the CSI &gt; <i>Ps</i>; <i>Ps</i> m
sequence. This corresponds to a resource value of "-1", which
cannot be set with the other sequence. The parameter identi-
fies the resource to be disabled:
<i>Ps</i> = 0 -&gt; modifyKeyboard.
<i>Ps</i> = 1 -&gt; modifyCursorKeys.
<i>Ps</i> = 2 -&gt; modifyFunctionKeys.
<i>Ps</i> = 4 -&gt; modifyOtherKeys.
If the parameter is omitted, <b>modifyFunctionKeys</b> is disabled.
When <b>modifyFunctionKeys</b> is disabled, <i>xterm</i> uses the modifier
keys to make an extended sequence of functions rather than
adding a parameter to each function key to denote the modi-
fiers.</del>
<del>CSI ? <i>Ps</i> n
Device Status Report (DSR, DEC-specific).
<i>Ps</i> = 6 -&gt; Report Cursor Position (DECXCPR) [row;column] as
CSI ? <i>r</i> ; <i>c</i> R (assumes the default page, i.e., "1").
<i>Ps</i> = 1 5 -&gt; Report Printer status as CSI ? 1 0 n (ready).
or CSI ? 1 1 n (not ready).
<i>Ps</i> = 2 5 -&gt; Report UDK status as CSI ? 2 0 n (unlocked) or
CSI ? 2 1 n (locked).
<i>Ps</i> = 2 6 -&gt; Report Keyboard status as
CSI ? 2 7 ; 1 ; 0 ; 0 n (North American).
The last two parameters apply to VT400 &amp; up, and denote key-
board ready and LK01 respectively.
<i>Ps</i> = 5 3 -&gt; Report Locator status as CSI ? 5 3 n Locator
available, if compiled-in, or CSI ? 5 0 n No Locator, if not.
<i>Ps</i> = 5 5 -&gt; Report Locator status as CSI ? 5 3 n Locator
available, if compiled-in, or CSI ? 5 0 n No Locator, if not.
<i>Ps</i> = 5 6 -&gt; Report Locator type as CSI ? 5 7 ; 1 n Mouse,
if compiled-in, or CSI ? 5 7 ; 0 n Cannot identify, if not.
<i>Ps</i> = 6 2 -&gt; Report macro space (DECMSR) as CSI <i>Pn</i> \* { .
<i>Ps</i> = 6 3 -&gt; Report memory checksum (DECCKSR) as DCS <i>Pt</i> ! x
x x x ST .
<i>Pt</i> is the request id (from an optional parameter to the
request).
The x's are hexadecimal digits 0-9 and A-F.
<i>Ps</i> = 7 5 -&gt; Report data integrity as CSI ? 7 0 n (ready,
no errors).
<i>Ps</i> = 8 5 -&gt; Report multi-session configuration as CSI ? 8 3
n (not configured for multiple-session operation).</del>
<del>CSI &gt; <i>Ps</i> p
Set resource value <i>pointerMode</i>. This is used by <i>xterm</i> to
decide whether to hide the pointer cursor as the user types.
Valid values for the parameter:
<i>Ps</i> = 0 -&gt; never hide the pointer.
<i>Ps</i> = 1 -&gt; hide if the mouse tracking mode is not enabled.
<i>Ps</i> = 2 -&gt; always hide the pointer, except when leaving the
window.
<i>Ps</i> = 3 -&gt; always hide the pointer, even if leaving/entering
the window. If no parameter is given, <i>xterm</i> uses the default,
which is 1 .</del>
CSI ! p Soft terminal reset (DECSTR).
<ins>This does the same as `ESC c` ("hard reset") in ESPTerm</ins>
<del>CSI <i>Ps</i> ; <i>Ps</i> " p
Set conformance level (DECSCL). Valid values for the first
parameter:
<i>Ps</i> = 6 1 -&gt; VT100.
<i>Ps</i> = 6 2 -&gt; VT200.
<i>Ps</i> = 6 3 -&gt; VT300.
Valid values for the second parameter:
<i>Ps</i> = 0 -&gt; 8-bit controls.
<i>Ps</i> = 1 -&gt; 7-bit controls (always set for VT100).
<i>Ps</i> = 2 -&gt; 8-bit controls.</del>
<del>CSI <i>Ps</i> $ p
Request ANSI mode (DECRQM). For VT300 and up, reply is
CSI <i>Ps</i>; <i>Pm</i>$ y
where <i>Ps</i> is the mode number as in RM, and <i>Pm</i> is the mode
value:
0 - not recognized
1 - set
2 - reset
3 - permanently set
4 - permanently reset</del>
<del>CSI ? <i>Ps</i>$ p
Request DEC private mode (DECRQM). For VT300 and up, reply is
CSI ? <i>Ps</i>; <i>Pm</i>$ y
where <i>Ps</i> is the mode number as in DECSET, <i>Pm</i> is the mode value
as in the ANSI DECRQM.</del>
<del>CSI <i>Ps</i> q Load LEDs (DECLL).
<i>Ps</i> = 0 -&gt; Clear all LEDS (default).
<i>Ps</i> = 1 -&gt; Light Num Lock.
<i>Ps</i> = 2 -&gt; Light Caps Lock.
<i>Ps</i> = 3 -&gt; Light Scroll Lock.
<i>Ps</i> = 2 1 -&gt; Extinguish Num Lock.
<i>Ps</i> = 2 2 -&gt; Extinguish Caps Lock.
<i>Ps</i> = 2 3 -&gt; Extinguish Scroll Lock.</del>
<del>CSI <i>Ps</i> SP q
Set cursor style (DECSCUSR, VT520).
<i>Ps</i> = 0 -&gt; blinking block.
<i>Ps</i> = 1 -&gt; blinking block (default).
<i>Ps</i> = 2 -&gt; steady block.
<i>Ps</i> = 3 -&gt; blinking underline.
<i>Ps</i> = 4 -&gt; steady underline.
<i>Ps</i> = 5 -&gt; blinking bar (xterm).
<i>Ps</i> = 6 -&gt; steady bar (xterm).</del>
<del>CSI <i>Ps</i> " q
Select character protection attribute (DECSCA). Valid values
for the parameter:
<i>Ps</i> = 0 -&gt; DECSED and DECSEL can erase (default).
<i>Ps</i> = 1 -&gt; DECSED and DECSEL cannot erase.
<i>Ps</i> = 2 -&gt; DECSED and DECSEL can erase.</del>
CSI <i>Ps</i> ; <i>Ps</i> r
Set Scrolling Region [top;bottom] (default = full size of win-
dow) (DECSTBM). <ins><b>TODO</b> implement</ins>
CSI ? <i>Pm</i> r
Restore DEC Private Mode Values. The value of <i>Ps</i> previously
saved is restored. <i>Ps</i> values are the same as for DECSET. <ins><b>TODO</b> implement</ins>
<del>CSI <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i>; <i>Ps</i>$ r
Change Attributes in Rectangular Area (DECCARA), VT400 and up.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.
<i>Ps</i> denotes the SGR attributes to change: 0, 1, 4, 5, 7.</del>
CSI s Save cursor (ANSI.SYS), <del>available only when DECLRMM is dis-
abled.</del> <ins>This saves only the position, not attributes.</ins>
<del>CSI <i>Pl</i>; <i>Pr</i> s
Set left and right margins (DECSLRM), available only when
DECLRMM is enabled (VT420 and up).</del>
CSI ? <i>Pm</i> s
Save DEC Private Mode Values. <i>Ps</i> values are the same as for
DECSET. <ins><b>TODO</b> implement</ins>
CSI <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> t
Window manipulation (from <i>dtterm</i>, as well as extensions).
These controls may be disabled using the <i>allowWindowOps</i>
resource. Valid values for the first (and any additional
parameters) are:
<del> <i>Ps</i> = 1 -&gt; De-iconify window.
<i>Ps</i> = 2 -&gt; Iconify window.
<i>Ps</i> = 3 ; <i>x</i> <i>;</i> <i>y</i> -&gt; Move window to [x, y].
<i>Ps</i> = 4 ; <i>height</i> <i>;</i> <i>width</i> -&gt; Resize the <i>xterm</i> window to
given height and width in pixels. Omitted parameters reuse
the current height or width. Zero parameters use the dis-
play's height or width.
<i>Ps</i> = 5 -&gt; Raise the <i>xterm</i> window to the front of the stack-
ing order.
<i>Ps</i> = 6 -&gt; Lower the <i>xterm</i> window to the bottom of the
stacking order.
<i>Ps</i> = 7 -&gt; Refresh the <i>xterm</i> window.</del>
<i>Ps</i> = 8 ; <i>height</i> <i>;</i> <i>width</i> -&gt; Resize the text area to given
height and width in characters. Omitted parameters reuse the
current height or width. Zero parameters use the display's
height or width.
<del> <i>Ps</i> = 9 ; 0 -&gt; Restore maximized window.
<i>Ps</i> = 9 ; 1 -&gt; Maximize window (i.e., resize to screen
size).
<i>Ps</i> = 9 ; 2 -&gt; Maximize window vertically.
<i>Ps</i> = 9 ; 3 -&gt; Maximize window horizontally.
<i>Ps</i> = 1 0 ; 0 -&gt; Undo full-screen mode.
<i>Ps</i> = 1 0 ; 1 -&gt; Change to full-screen.
<i>Ps</i> = 1 0 ; 2 -&gt; Toggle full-screen.
<i>Ps</i> = 1 1 -&gt; Report <i>xterm</i> window state. If the <i>xterm</i> window
is open (non-iconified), it returns CSI 1 t . If the <i>xterm</i>
window is iconified, it returns CSI 2 t .
<i>Ps</i> = 1 3 -&gt; Report <i>xterm</i> window position.
Result is CSI 3 ; <i>x</i> ; <i>y</i> t
<i>Ps</i> = 1 4 -&gt; Report <i>xterm</i> window in pixels.
Result is CSI 4 ; <i>height</i> ; <i>width</i> t</del>
<i>Ps</i> = 1 8 -&gt; Report the size of the text area in characters.
Result is CSI 8 ; <i>height</i> ; <i>width</i> t
<del> <i>Ps</i> = 1 9 -&gt; Report the size of the screen in characters.
Result is CSI 9 ; <i>height</i> ; <i>width</i> t
<i>Ps</i> = 2 0 -&gt; Report <i>xterm</i> window's icon label.
Result is OSC L <i>label</i> ST</del>
<i>Ps</i> = 2 1 -&gt; Report <i>xterm</i> window's title.
Result is OSC l <i>label</i> ST
<del> <i>Ps</i> = 2 2 ; 0 -&gt; Save <i>xterm</i> icon and window title on
stack.
<i>Ps</i> = 2 2 ; 1 -&gt; Save <i>xterm</i> icon title on stack.
<i>Ps</i> = 2 2 ; 2 -&gt; Save <i>xterm</i> window title on stack.
<i>Ps</i> = 2 3 ; 0 -&gt; Restore <i>xterm</i> icon and window title from
stack.
<i>Ps</i> = 2 3 ; 1 -&gt; Restore <i>xterm</i> icon title from stack.
<i>Ps</i> = 2 3 ; 2 -&gt; Restore <i>xterm</i> window title from stack.</del>
<i>Ps</i> &gt;= 2 4 -&gt; Resize to <i>Ps</i> lines (DECSLPP).
<del>CSI &gt; <i>Ps</i>; <i>Ps</i> t
Set one or more features of the title modes. Each parameter
enables a single feature.
<i>Ps</i> = 0 -&gt; Set window/icon labels using hexadecimal.
<i>Ps</i> = 1 -&gt; Query window/icon labels using hexadecimal.
<i>Ps</i> = 2 -&gt; Set window/icon labels using UTF-8.
<i>Ps</i> = 3 -&gt; Query window/icon labels using UTF-8. (See dis-
cussion of "Title Modes")</del>
<del>CSI <i>Ps</i> SP t
Set warning-bell volume (DECSWBV, VT520).
<i>Ps</i> = 0 or 1 -&gt; off.
<i>Ps</i> = 2 , 3 or 4 -&gt; low.
<i>Ps</i> = 5 , 6 , 7 , or 8 -&gt; high.</del>
<del>CSI <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i>; <i>Ps</i>$ t
Reverse Attributes in Rectangular Area (DECRARA), VT400 and
up.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.
<i>Ps</i> denotes the attributes to reverse, i.e., 1, 4, 5, 7.</del>
CSI u Restore cursor (ANSI.SYS). <ins>This restores only the position.</ins>
<del>CSI <i>Ps</i> SP u
Set margin-bell volume (DECSMBV, VT520).
<i>Ps</i> = 1 -&gt; off.
<i>Ps</i> = 2 , 3 or 4 -&gt; low.
<i>Ps</i> = 0 , 5 , 6 , 7 , or 8 -&gt; high.</del>
<del>CSI <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i>; <i>Pp</i>; <i>Pt</i>; <i>Pl</i>; <i>Pp</i>$ v
Copy Rectangular Area (DECCRA, VT400 and up).
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.
<i>Pp</i> denotes the source page.
<i>Pt</i>; <i>Pl</i> denotes the target location.
<i>Pp</i> denotes the target page.</del>
<del>CSI <i>Pt</i> ; <i>Pl</i> ; <i>Pb</i> ; <i>Pr</i> ' w
Enable Filter Rectangle (DECEFR), VT420 and up.
Parameters are [top;left;bottom;right].
Defines the coordinates of a filter rectangle and activates
it. Anytime the locator is detected outside of the filter
rectangle, an outside rectangle event is generated and the
rectangle is disabled. Filter rectangles are always treated
as "one-shot" events. Any parameters that are omitted default
to the current locator position. If all parameters are omit-
ted, any locator motion will be reported. DECELR always can-
cels any prevous rectangle definition.</del>
CSI <i>Ps</i> x Request Terminal Parameters (DECREQTPARM).
if <i>Ps</i> is a "0" (default) or "1", and <i>xterm</i> is emulating VT100,
the control sequence elicits a response of the same form whose
parameters describe the terminal:
<i>Ps</i> -&gt; the given <i>Ps</i> incremented by 2.
<i>Pn</i> = 1 &lt;- no parity.
<i>Pn</i> = 1 &lt;- eight bits.
<i>Pn</i> = 1 &lt;- <del>2 8 transmit 38.4k baud.</del> <ins>Transmit speed (baud)</ins>
<i>Pn</i> = 1 &lt;- </del>2 8 receive 38.4k baud.</del> <ins>Receive speed (baud)</ins>
<i>Pn</i> = 1 &lt;- clock multiplier.
<i>Pn</i> = 0 &lt;- STP flags.<!--
--><ins block>The baud rate is retrieved from a lookup table based on the current ESPTerm settings.
See the source code for the full list. Examples: 120 = 38400, 144 = 115200 baud. <i>What this function is
good for remains a mystery??</i></ins><!--
--><del>CSI <i>Ps</i> * x
Select Attribute Change Extent (DECSACE).
<i>Ps</i> = 0 -&gt; from start to end position, wrapped.
<i>Ps</i> = 1 -&gt; from start to end position, wrapped.
<i>Ps</i> = 2 -&gt; rectangle (exact).</del>
<del>CSI <i>Pc</i> ; <i>Pt</i> ; <i>Pl</i> ; <i>Pb</i> ; <i>Pr</i> $ x
Fill Rectangular Area (DECFRA), VT420 and up.
<i>Pc</i> is the character to use.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.</del>
<del>CSI <i>Pi</i> ; <i>Pg</i> ; <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> * y
Request Checksum of Rectangular Area (DECRQCRA), VT420 and up.
Response is
DCS <i>Pi</i> ! x x x x ST
<i>Pi</i> is the request id.
<i>Pg</i> is the page number.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.
The x's are hexadecimal digits 0-9 and A-F.</del>
<del>CSI <i>Ps</i> ; <i>Pu</i> ' z
Enable Locator Reporting (DECELR).
Valid values for the first parameter:
<i>Ps</i> = 0 -&gt; Locator disabled (default).
<i>Ps</i> = 1 -&gt; Locator enabled.
<i>Ps</i> = 2 -&gt; Locator enabled for one report, then disabled.
The second parameter specifies the coordinate unit for locator
reports.
Valid values for the second parameter:
<i>Pu</i> = 0 &lt;- or omitted -&gt; default to character cells.
<i>Pu</i> = 1 &lt;- device physical pixels.
<i>Pu</i> = 2 &lt;- character cells.</del>
<del>CSI <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i>$ z
Erase Rectangular Area (DECERA), VT400 and up.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.</del>
<del>CSI <i>Pm</i> ' {
Select Locator Events (DECSLE).
Valid values for the first (and any additional parameters)
are:
<i>Ps</i> = 0 -&gt; only respond to explicit host requests (DECRQLP).
(This is default). It also cancels any filter
rectangle.
<i>Ps</i> = 1 -&gt; report button down transitions.
<i>Ps</i> = 2 -&gt; do not report button down transitions.
<i>Ps</i> = 3 -&gt; report button up transitions.
<i>Ps</i> = 4 -&gt; do not report button up transitions.</del>
<del>CSI <i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> $ {
Selective Erase Rectangular Area (DECSERA), VT400 and up.
<i>Pt</i>; <i>Pl</i>; <i>Pb</i>; <i>Pr</i> denotes the rectangle.</del>
<del>CSI <i>Ps</i> ' |
Request Locator Position (DECRQLP).
Valid values for the parameter are:
<i>Ps</i> = 0 , 1 or omitted -&gt; transmit a single DECLRP locator
report.
If Locator Reporting has been enabled by a DECELR, <i>xterm</i> will
respond with a DECLRP Locator Report. This report is also
generated on button up and down events if they have been
enabled with a DECSLE, or when the locator is detected outside
of a filter rectangle, if filter rectangles have been enabled
with a DECEFR.
-&gt; CSI <i>Pe</i> ; <i>Pb</i> ; <i>Pr</i> ; <i>Pc</i> ; <i>Pp</i> &amp; w
Parameters are [<i>event</i>;<i>button</i>;<i>row</i>;<i>column</i>;<i>page</i>].
Valid values for the event:
<i>Pe</i> = 0 -&gt; locator unavailable - no other parameters sent.
<i>Pe</i> = 1 -&gt; request - <i>xterm</i> received a DECRQLP.
<i>Pe</i> = 2 -&gt; left button down.
<i>Pe</i> = 3 -&gt; left button up.
<i>Pe</i> = 4 -&gt; middle button down.
<i>Pe</i> = 5 -&gt; middle button up.
<i>Pe</i> = 6 -&gt; right button down.
<i>Pe</i> = 7 -&gt; right button up.
<i>Pe</i> = 8 -&gt; M4 button down.
<i>Pe</i> = 9 -&gt; M4 button up.
<i>Pe</i> = 1 0 -&gt; locator outside filter rectangle.
The "<i>button</i>" parameter is a bitmask indicating which buttons
are pressed:
<i>Pb</i> = 0 &lt;- no buttons down.
<i>Pb</i> &amp; 1 &lt;- right button down.
<i>Pb</i> &amp; 2 &lt;- middle button down.
<i>Pb</i> &amp; 4 &lt;- left button down.
<i>Pb</i> &amp; 8 &lt;- M4 button down.
The "<i>row</i>" and "<i>column</i>" parameters are the coordinates of the
locator position in the <i>xterm</i> window, encoded as ASCII deci-
mal.
The "<i>page</i>" parameter is not used by xterm.</del>
<del>CSI <i>Pm</i> ' }
Insert <i>Ps</i> Column(s) (default = 1) (DECIC), VT420 and up.</del>
<del>CSI <i>Pm</i> ' ~
Delete <i>Ps</i> Column(s) (default = 1) (DECDC), VT420 and up.</del>
</pre>
<h2><a name="h2-Operating-System-Commands" id="h2-Operating-System-Commands">Operating System Commands</a></h2>
<pre>
OSC <i>Ps</i> ; <i>Pt</i> BEL
OSC <i>Ps</i> ; <i>Pt</i> ST
Set Text Parameters. For colors and font, if <i>Pt</i> is a "?", the
control sequence elicits a response which consists of the con-
trol sequence which would set the corresponding value. The
<i>dtterm</i> control sequences allow you to determine the icon name
and window title.
<i>Ps</i> = 0 -&gt; Change <del>Icon Name and</del> Window Title to <i>Pt</i>.
<del><i>Ps</i> = 1 -&gt; Change Icon Name to <i>Pt</i>.</del>
<i>Ps</i> = 2 -&gt; Change Window Title to <i>Pt</i>.
<del><i>Ps</i> = 3 -&gt; Set X property on top-level window. <i>Pt</i> should be
in the form "<i>prop=value</i>", or just "<i>prop</i>" to delete the prop-
erty</del>
<del><i>Ps</i> = 4 ; <i>c</i>; <i>spec</i> -&gt; Change Color Number <i>c</i> to the color spec-
ified by <i>spec</i>. This can be a name or RGB specification as per
<i>XParseColor</i>. Any number of <i>c</i>/<i>spec</i> pairs may be given. The
color numbers correspond to the ANSI colors 0-7, their bright
versions 8-15, and if supported, the remainder of the 88-color
or 256-color table.
If a "?" is given rather than a name or RGB specification,
<i>xterm</i> replies with a control sequence of the same form which
can be used to set the corresponding color. Because more than
one pair of color number and specification can be given in one
control sequence, <i>xterm</i> can make more than one reply.
<i>Ps</i> = 5 ; <i>c</i>; <i>spec</i> -&gt; Change Special Color Number <i>c</i> to the
color specified by <i>spec</i>. This can be a name or RGB specifica-
tion as per <i>XParseColor</i>. Any number of <i>c</i>/<i>spec</i> pairs may be
given. The special colors can also be set by adding the maxi-
mum number of colors to these codes in an OSC 4 control:
<i>Pc</i> = 0 &lt;- resource <b>colorBD</b> (BOLD).
<i>Pc</i> = 1 &lt;- resource <b>colorUL</b> (UNDERLINE).
<i>Pc</i> = 2 &lt;- resource <b>colorBL</b> (BLINK).
<i>Pc</i> = 3 &lt;- resource <b>colorRV</b> (REVERSE).
<i>Pc</i> = 4 &lt;- resource <b>colorIT</b> (ITALIC).
<i>Ps</i> = 6 ; <i>c</i>; <i>f</i> -&gt; Enable/disable Special Color Number <i>c</i>. OSC
6 is the same as OSC 1 0 6 .
The 10 colors (below) which may be set or queried using 1 0
through 1 9 are denoted <i>dynamic</i> <i>colors</i>, since the correspond-
ing control sequences were the first means for setting <i>xterm</i>'s
colors dynamically, i.e., after it was started. They are not
the same as the ANSI colors. These controls may be disabled
using the <i>allowColorOps</i> resource. At least one parameter is
expected for <i>Pt</i>. Each successive parameter changes the next
color in the list. The value of <i>Ps</i> tells the starting point
in the list. The colors are specified by name or RGB specifi-
cation as per <i>XParseColor</i>.
If a "?" is given rather than a name or RGB specification,
<i>xterm</i> replies with a control sequence of the same form which
can be used to set the corresponding dynamic color. Because
more than one pair of color number and specification can be
given in one control sequence, <i>xterm</i> can make more than one
reply.
<i>Ps</i> = 1 0 -&gt; Change VT100 text foreground color to <i>Pt</i>.
<i>Ps</i> = 1 1 -&gt; Change VT100 text background color to <i>Pt</i>.
<i>Ps</i> = 1 2 -&gt; Change text cursor color to <i>Pt</i>.
<i>Ps</i> = 1 3 -&gt; Change mouse foreground color to <i>Pt</i>.
<i>Ps</i> = 1 4 -&gt; Change mouse background color to <i>Pt</i>.
<i>Ps</i> = 1 5 -&gt; Change Tektronix foreground color to <i>Pt</i>.
<i>Ps</i> = 1 6 -&gt; Change Tektronix background color to <i>Pt</i>.
<i>Ps</i> = 1 7 -&gt; Change highlight background color to <i>Pt</i>.
<i>Ps</i> = 1 8 -&gt; Change Tektronix cursor color to <i>Pt</i>.
<i>Ps</i> = 1 9 -&gt; Change highlight foreground color to <i>Pt</i>.
<i>Ps</i> = 4 6 -&gt; Change Log File to <i>Pt</i>. (This is normally dis-
abled by a compile-time option).
<i>Ps</i> = 5 0 -&gt; Set Font to <i>Pt</i>. These controls may be disabled
using the <i>allowFontOps</i> resource. If <i>Pt</i> begins with a "#",
index in the font menu, relative (if the next character is a
plus or minus sign) or absolute. A number is expected but not
required after the sign (the default is the current entry for
relative, zero for absolute indexing).
The same rule (plus or minus sign, optional number) is used
when querying the font. The remainder of <i>Pt</i> is ignored.
A font can be specified after a "#" index expression, by
adding a space and then the font specifier.
If the "TrueType Fonts" menu entry is set (the <b>renderFont</b>
resource), then this control sets/queries the <b>faceName</b>
resource.
<i>Ps</i> = 5 1 -&gt; reserved for Emacs shell.
<i>Ps</i> = 5 2 -&gt; Manipulate Selection Data. These controls may
be disabled using the <i>allowWindowOps</i> resource. The parameter
<i>Pt</i> is parsed as
<i>Pc</i>; <i>Pd</i>
The first, <i>Pc</i>, may contain zero or more characters from the
set c p s 0 1 2 3 4 5 6 7 . It is used to construct
a list of selection parameters for clipboard, primary, select,
or cut buffers 0 through 7 respectively, in the order given.
If the parameter is empty, <i>xterm</i> uses s 0 , to specify the
configurable primary/clipboard selection and cut buffer 0.
The second parameter, <i>Pd</i>, gives the selection data. Normally
this is a string encoded in base64. The data becomes the new
selection, which is then available for pasting by other appli-
cations.
If the second parameter is a ? , <i>xterm</i> replies to the host
with the selection data encoded using the same protocol.
If the second parameter is neither a base64 string nor ? ,
then the selection is cleared.
<i>Ps</i> = 1 0 4 ; <i>c</i> -&gt; Reset Color Number <i>c</i>. It is reset to the
color specified by the corresponding X resource. Any number
of <i>c</i> parameters may be given. These parameters correspond to
the ANSI colors 0-7, their bright versions 8-15, and if sup-
ported, the remainder of the 88-color or 256-color table. If
no parameters are given, the entire table will be reset.
<i>Ps</i> = 1 0 5 ; <i>c</i> -&gt; Reset Special Color Number <i>c</i>. It is reset
to the color specified by the corresponding X resource. Any
number of <i>c</i> parameters may be given. These parameters corre-
spond to the special colors which can be set using an OSC 5
control (or by adding the maximum number of colors using an
OSC 4 control).
<i>Ps</i> = 1 0 6 ; <i>c</i>; <i>f</i> -&gt; Enable/disable Special Color Number <i>c</i>.
The second parameter tells <i>xterm</i> to enable the corresponding
color mode if nonzero, disable it if zero.
<i>Pc</i> = 0 &lt;- resource <b>colorBDMode</b> (BOLD).
<i>Pc</i> = 1 &lt;- resource <b>colorULMode</b> (UNDERLINE).
<i>Pc</i> = 2 &lt;- resource <b>colorBLMode</b> (BLINK).
<i>Pc</i> = 3 &lt;- resource <b>colorRVMode</b> (REVERSE).
<i>Pc</i> = 4 &lt;- resource <b>colorITMode</b> (ITALIC).
<i>Pc</i> = 5 &lt;- resource <b>colorAttrMode</b> (Override ANSI).
The <i>dynamic</i> <i>colors</i> can also be reset to their default
(resource) values:
<i>Ps</i> = 1 1 0 -&gt; Reset VT100 text foreground color.
<i>Ps</i> = 1 1 1 -&gt; Reset VT100 text background color.
<i>Ps</i> = 1 1 2 -&gt; Reset text cursor color.
<i>Ps</i> = 1 1 3 -&gt; Reset mouse foreground color.
<i>Ps</i> = 1 1 4 -&gt; Reset mouse background color.
<i>Ps</i> = 1 1 5 -&gt; Reset Tektronix foreground color.
<i>Ps</i> = 1 1 6 -&gt; Reset Tektronix background color.
<i>Ps</i> = 1 1 7 -&gt; Reset highlight color.
<i>Ps</i> = 1 1 8 -&gt; Reset Tektronix cursor color.
<i>Ps</i> = 1 1 9 -&gt; Reset highlight foreground color.</del>
</pre>
<h2><a name="h2-Privacy-Message" id="h2-Privacy-Message">Privacy Message</a></h2>
<pre>
PM <i>Pt</i> ST <i>xterm</i> implements no PM functions; <i>Pt</i> is ignored. <del><i>Pt</i> need not
be printable characters.</del>
</pre>
<h2><a name="h2-Alt-and-Meta-Keys" id="h2-Alt-and-Meta-Keys">Alt and Meta Keys</a></h2>
<ins block>
<p>ESPTerm does not implement Alt and Meta keys, however it implements Ctrl and some Shift keys.
For more info, please move on to the next section.</p>
</ins>
<pre><del>
Many keyboards have keys labeled "Alt". Few have keys labeled "Meta".
However, <i>xterm</i>'s default translations use the <i>Meta</i> modifier. Common
keyboard configurations assign the <i>Meta</i> modifier to an "Alt" key. By
using <i>xmodmap</i> one may have the modifier assigned to a different key, and
have "real" alt and meta keys. Here is an example:
! put meta on mod3 to distinguish it from alt
keycode 64 = Alt_L
clear mod1
add mod1 = Alt_L
keycode 115 = Meta_L
clear mod3
add mod3 = Meta_L
The <b>metaSendsEscape</b> resource (and <b>altSendsEscape</b> if <b>altIsNotMeta</b> is set)
can be used to control the way the <i>Meta</i> modifier applies to ordinary
keys unless the <b>modifyOtherKeys</b> resource is set:
- prefix a key with the ESC character.
- shift the key from codes 0-127 to 128-255 by adding 128.
The table shows the result for a given character "x" with modifiers
according to the default translations with the resources set on or off.
This assumes <b>altIsNotMeta</b> is set:
-----------------------------------------------------------
<b>key</b> <b>altSendsEscape</b> <b>metaSendsEscape</b> <b>result</b>
-----------+----------------+-----------------+------------
x | off | off | x
Meta-x | off | off | shift
Alt-x | off | off | shift
Alt+Meta-x | off | off | shift
x | ON | off | x
Meta-x | ON | off | shift
Alt-x | ON | off | ESC x
Alt+Meta-x | ON | off | ESC shift
x | off | ON | x
Meta-x | off | ON | ESC x
Alt-x | off | ON | shift
Alt+Meta-x | off | ON | ESC shift
x | ON | ON | x
Meta-x | ON | ON | ESC x
Alt-x | ON | ON | ESC x
Alt+Meta-x | ON | ON | ESC x
-----------+----------------+-----------------+------------
</del></pre>
<h2><a name="h2-PC-Style-Function-Keys" id="h2-PC-Style-Function-Keys">PC-Style Function Keys</a></h2>
<ins block>
<p>
ESPTerm's implementation of key codes is mostly based on this section and on what is expected by real
applications. For example, the MicroMite Basic does not support SS3 codes, so there is a toggle for those
in the settings.
</p>
<p>A quick summary of keyboard support:</p>
<ul>
<li>Any graphic characters, including UTF-8 code points, can be sent directly from the keyboard. On Android,
the soft keyboard can be opened by tapping the keyboard icon beneath the screen.</li>
<li>Ctrl+A..Z produce low ASCII codes (A = 1, through Z = 26), Ctrl+],/,[,^,_ produce codes 27 through 31.</li>
<li>Cursor keys, Home and End can be switched between CSI and SS3 mode by <code>DECCKM</code>.</li>
<li>The codes sent by F1-F4, Home and End can be adjusted by toggles on the config page.</li>
<li>The numeric keypad, if your machine has it, can send alternate key codes if the terminal is switched
to "Application Keypad Mode". This is described below, look for <code>DECKPAM</code> and <code>DECKPNM</code></li>
</ul>
<p>
In general, the best way to check what codes are sent is to look at the UART output with an
application like GtkTerm or PuTTY, if they can show the codes without interpreting them.
Alternatively, connect ESPTerm to a Linux machine, start <code>agetty</code> on the serial port,
run <code>cat</code> in shell and press they keys you're interested in. It will first show them
as plaintext, then interpret them when you press enter. Incidentally, this can also be used
to test escape sequences and application support. ESPTerm is known to run eg. mc, neovim or nano without issues.
</p>
</ins>
<pre>
If <i>xterm</i> does minimal translation of the function keys, it usually does
this with a PC-style keyboard, so PC-style function keys result. Sun
keyboards are similar to PC keyboards. Both have cursor and scrolling
operations printed on the keypad, which duplicate the smaller cursor and
scrolling keypads.
X does not predefine NumLock (used for VT220 keyboards) or Alt (used as
an extension for the Sun/PC keyboards) as modifiers. These keys are
recognized as modifiers when enabled by the <b>numLock</b> resource, or by the
"DECSET 1 0 3 5 " control sequence.</del>
The cursor keys transmit the following escape sequences depending on the
mode specified via the <b>DECCKM</b> escape sequence.
<b>Key</b> <b>Normal</b> <b>Application</b>
-------------+----------+-------------
Cursor Up | CSI A | SS3 A
Cursor Down | CSI B | SS3 B
Cursor Right | CSI C | SS3 C
Cursor Left | CSI D | SS3 D
-------------+----------+-------------
The home- and end-keys (unlike PageUp and other keys also on the 6-key
editing keypad) are considered "cursor keys" by <i>xterm</i>. Their mode is
also controlled by the <b>DECCKM</b> escape sequence:
<b>Key</b> <b>Normal</b> <b>Application</b>
---------+----------+-------------
Home | CSI H | SS3 H
End | CSI F | SS3 F
---------+----------+-------------
The application keypad transmits the following escape sequences depend-
ing on the mode specified via the <b>DECKPNM</b> and <b>DECKPAM</b> escape sequences.
Use the NumLock key to override the application mode.
Not all keys are present on the Sun/PC keypad (e.g., PF1, Tab), but are
supported by the program.
<b>Key</b> <b>Numeric</b> <b>Application</b> <b>Terminfo</b> <b>Termcap</b>
---------------+----------+-------------+----------+----------
Space | SP | SS3 SP | - | -
Tab | TAB | SS3 I | - | -
Enter | CR | SS3 M | kent | @8
PF1 | SS3 P | SS3 P | kf1 | k1
PF2 | SS3 Q | SS3 Q | kf2 | k2
PF3 | SS3 R | SS3 R | kf3 | k3
PF4 | SS3 S | SS3 S | kf4 | k4
* (multiply) | * | SS3 j | - | -
+ (add) | + | SS3 k | - | -
, (comma) | , | SS3 l | - | -
- (minus) | - | SS3 m | - | -
. (Delete) | . | CSI 3 ~ | - | -
/ (divide) | / | SS3 o | - | -
0 (Insert) | 0 | CSI 2 ~ | - | -
1 (End) | 1 | SS3 F | kc1 | K4
2 (DownArrow) | 2 | CSI B | - | -
3 (PageDown) | 3 | CSI 6 ~ | kc3 | K5
4 (LeftArrow) | 4 | CSI D | - | -
5 (Begin) | 5 | CSI E | kb2 | K2
6 (RightArrow) | 6 | CSI C | - | -
7 (Home) | 7 | SS3 H | ka1 | K1
8 (UpArrow) | 8 | CSI A | - | -
9 (PageUp) | 9 | CSI 5 ~ | ka3 | K3
= (equal) | = | SS3 X | - | -
---------------+----------+-------------+----------+----------
They also provide 12 function keys, as well as a few other special-pur-
pose keys:
<b>Key</b> <b>Escape</b> <b>Sequence</b>
---------+-----------------
F1 | SS3 P
F2 | SS3 Q
F3 | SS3 R
F4 | SS3 S
F5 | CSI 1 5 ~
F6 | CSI 1 7 ~
F7 | CSI 1 8 ~
F8 | CSI 1 9 ~
F9 | CSI 2 0 ~
F10 | CSI 2 1 ~
F11 | CSI 2 3 ~
F12 | CSI 2 4 ~
---------+-----------------
Note that F1 through F4 are prefixed with SS3 , while the other keys are
prefixed with CSI . Older versions of <i>xterm</i> implement different escape
sequences for F1 through F4, with a CSI prefix. These can be activated
by setting the <b>oldXtermFKeys</b> resource. However, since they do not cor-
respond to any hardware terminal, they have been deprecated. (The DEC
VT220 reserves F1 through F5 for local functions such as <b>Setup</b>).
<b>Key</b> <b>Escape</b> <b>Sequence</b>
---------+-----------------
F1 | CSI 1 1 ~
F2 | CSI 1 2 ~
F3 | CSI 1 3 ~
F4 | CSI 1 4 ~
---------+-----------------
In normal mode, i.e., a Sun/PC keyboard when the <b>sunKeyboard</b> resource is
false (and none of the other keyboard resources such as <b>oldXtermFKeys</b>
resource is set), <i>xterm</i> encodes function key modifiers as parameters
appended before the <i>final</i> character of the control sequence. As a spe-
cial case, the SS3 sent before F1 through F4 is altered to CSI when
sending a function key modifier as a parameter.
<ins block>Generally, ESPTerm supports only Shift adn Ctrl in some combinations.</ins>
<b>Code</b> <b>Modifiers</b>
---------+---------------------------
2 | Shift
3 | Alt
4 | Shift + Alt
5 | Control
6 | Shift + Control
7 | Alt + Control
8 | Shift + Alt + Control
9 | Meta
10 | Meta + Shift
11 | Meta + Alt
12 | Meta + Alt + Shift
13 | Meta + Ctrl
14 | Meta + Ctrl + Shift
15 | Meta + Ctrl + Alt
16 | Meta + Ctrl + Alt + Shift
---------+---------------------------
For example, shift-F5 would be sent as CSI 1 5 ; 2 ~
If the <b>alwaysUseMods</b> resource is set, the Meta modifier also is recog-
nized, making parameters 9 through 16.
</pre>
<h2><a name="h2-VT220-Style-Function-Keys" id="h2-VT220-Style-Function-Keys">VT220-Style Function Keys</a></h2>
<pre>
However, <i>xterm</i> is most useful as a DEC VT102 or VT220 emulator. <del>Set the
<b>sunKeyboard</b> resource to true to force a Sun/PC keyboard to act like a
VT220 keyboard.</del>
<ins block><i>Some information here may be irrelevant for ESPTerm.</i></ins>
The VT102/VT220 application keypad transmits unique escape sequences in
application mode, which are distinct from the cursor and scrolling key-
pad:
<b>Key</b> <b>Numeric</b> <b>Application</b>
-------------+----------+-------------
Space | SP | SS3 SP
Tab | TAB | SS3 I
Enter | CR | SS3 M
PF1 | SS3 P | SS3 P
PF2 | SS3 Q | SS3 Q
PF3 | SS3 R | SS3 R
PF4 | SS3 S | SS3 S
* (multiply) | * | SS3 j
+ (add) | + | SS3 k
, (comma) | , | SS3 l
- (minus) | - | SS3 m
. (period) | . | SS3 n
/ (divide) | / | SS3 o
0 | 0 | SS3 p
1 | 1 | SS3 q
2 | 2 | SS3 r
3 | 3 | SS3 s
4 | 4 | SS3 t
5 | 5 | SS3 u
6 | 6 | SS3 v
7 | 7 | SS3 w
8 | 8 | SS3 x
9 | 9 | SS3 y
= (equal) | = | SS3 X
-------------+----------+-------------
The VT220 provides a 6-key editing keypad, which is analogous to that on
the PC keyboard. It is not affected by <b>DECCKM</b> or <b>DECKPNM</b>/<b>DECKPAM</b>:
<b>Key</b> <b>Normal</b> <b>Application</b>
---------+----------+-------------
Insert | CSI 2 ~ | CSI 2 ~
Delete | CSI 3 ~ | CSI 3 ~
Home | CSI 1 ~ | CSI 1 ~
End | CSI 4 ~ | CSI 4 ~
PageUp | CSI 5 ~ | CSI 5 ~
PageDown | CSI 6 ~ | CSI 6 ~
---------+----------+-------------
The VT220 provides 8 additional function keys. With a Sun/PC keyboard,
access these keys by Control/F1 for F13, etc.
<b>Key</b> <b>Escape</b> <b>Sequence</b>
---------+-----------------
F13 | CSI 2 5 ~
F14 | CSI 2 6 ~
F15 | CSI 2 8 ~
F16 | CSI 2 9 ~
F17 | CSI 3 1 ~
F18 | CSI 3 2 ~
F19 | CSI 3 3 ~
F20 | CSI 3 4 ~
---------+-----------------
</pre>
<h2><a name="h2-VT52-Style-Function-Keys" id="h2-VT52-Style-Function-Keys">VT52-Style Function Keys</a></h2>
<pre>
<ins block><i>VT52 modes are summarily not implemented in ESPTerm.</i></ins><del>
A VT52 does not have function keys, but it does have a numeric keypad
and cursor keys. They differ from the other emulations by the prefix.
Also, the cursor keys do not change:
<b>Key</b> <b>Normal/Application</b>
-------------+--------------------
Cursor Up | ESC A
Cursor Down | ESC B
Cursor Right | ESC C
Cursor Left | ESC D
-------------+--------------------
The keypad is similar:
<b>Key</b> <b>Numeric</b> <b>Application</b>
-------------+----------+-------------
Space | SP | ESC ? SP
Tab | TAB | ESC ? I
Enter | CR | ESC ? M
PF1 | ESC P | ESC P
PF2 | ESC Q | ESC Q
PF3 | ESC R | ESC R
PF4 | ESC S | ESC S
* (multiply) | * | ESC ? j
+ (add) | + | ESC ? k
, (comma) | , | ESC ? l
- (minus) | - | ESC ? m
. (period) | . | ESC ? n
/ (divide) | / | ESC ? o
0 | 0 | ESC ? p
1 | 1 | ESC ? q
2 | 2 | ESC ? r
3 | 3 | ESC ? s
4 | 4 | ESC ? t
5 | 5 | ESC ? u
6 | 6 | ESC ? v
7 | 7 | ESC ? w
8 | 8 | ESC ? x
9 | 9 | ESC ? y
= (equal) | = | ESC ? X
-------------+----------+-------------
</del></pre>
<h2><a name="h2-Sun-Style-Function-Keys" id="h2-Sun-Style-Function-Keys">Sun-Style Function Keys</a></h2>
<pre><del>
The <i>xterm</i> program provides support for Sun keyboards more directly, by a
menu toggle that causes it to send Sun-style function key codes rather
than VT220. Note, however, that the <i>sun</i> and <i>VT100</i> emulations are not
really compatible. For example, their wrap-margin behavior differs.
Only function keys are altered; keypad and cursor keys are the same.
The emulation responds identically. See the xterm-sun terminfo entry
for details.
</del></pre>
<h2><a name="h2-HP-Style-Function-Keys" id="h2-HP-Style-Function-Keys">HP-Style Function Keys</a></h2>
<pre><del>
Similarly, <i>xterm</i> can be compiled to support HP keyboards. See the
xterm-hp terminfo entry for details.
</del></pre>
<h2><a name="h2-The-Alternate-Screen-Buffer" id="h2-The-Alternate-Screen-Buffer">The Alternate Screen Buffer</a></h2>
<ins block>ESPTerm implements this feature only partly due to RAM constraints. See <a href="#SET1047"><code>CSI ? 1 0 4 7 h</code></a> (above) for more details.</ins>
<pre>
<i>Xterm</i> maintains two screen buffers. The normal screen buffer allows you
to scroll back to view saved lines of output up to the maximum set by
the <b>saveLines</b> resource. The alternate screen buffer is exactly as large
as the display, contains no additional saved lines. When the alternate
screen buffer is active, you cannot scroll back to view saved lines.
<i>Xterm</i> provides control sequences and menu entries for switching between
the two.
Most full-screen applications use terminfo or termcap to obtain strings
used to start/stop full-screen mode, i.e., <i>smcup</i> and <i>rmcup</i> for terminfo,
or the corresponding <i>ti</i> and <i>te</i> for termcap. The <b>titeInhibit</b> resource
removes the <i>ti</i> and <i>te</i> strings from the TERMCAP string which is set in
the environment for some platforms. That is not done when <i>xterm</i> is
built with terminfo libraries because terminfo does not provide the
whole text of the termcap data in one piece. It would not work for ter-
minfo anyway, since terminfo data is not passed in environment vari-
ables; setting an environment variable in this manner would have no
effect on the application's ability to switch between normal and alter-
nate screen buffers. Instead, the newer private mode controls (such as
1 0 4 9 ) for switching between normal and alternate screen buffers sim-
ply disable the switching. They add other features such as clearing the
display for the same reason: to make the details of switching indepen-
dent of the application that requests the switch.
</pre>
<h2><a name="h2-Bracketed-Paste-Mode" id="h2-Bracketed-Paste-Mode">Bracketed Paste Mode</a></h2>
<pre><del>
When bracketed paste mode is set, pasted text is bracketed with control
sequences so that the program can differentiate pasted text from typed-
in text. When bracketed paste mode is set, the program will receive:
ESC [ 2 0 0 ~ ,
followed by the pasted text, followed by
ESC [ 2 0 1 ~ .
</del></pre>
<h2><a name="h2-Title-Modes" id="h2-Title-Modes">Title Modes</a></h2>
<pre><del>
The window- and icon-labels can be set or queried using control
sequences. As a VT220-emulator, <i>xterm</i> "should" limit the character
encoding for the corresponding strings to ISO-8859-1. Indeed, it used
to be the case (and was documented) that window titles had to be
ISO-8859-1. This is no longer the case. However, there are many appli-
cations which still assume that titles are set using ISO-8859-1. So
that is the default behavior.
If <i>xterm</i> is running with UTF-8 encoding, it is possible to use window-
and icon-labels encoded using UTF-8. That is because the underlying X
libraries (and many, but not all) window managers support this feature.
The <b>utf8Title</b> X resource setting tells <i>xterm</i> to disable a reconversion
of the title string back to ISO-8859-1, allowing the title strings to be
interpreted as UTF-8. The same feature can be enabled using the title
mode control sequence described in this summary.
Separate from the ability to set the titles, <i>xterm</i> provides the ability
to query the titles, returning them either in ISO-8859-1 or UTF-8. This
choice is available only while <i>xterm</i> is using UTF-8 encoding.
Finally, the characters sent to, or returned by a title control are less
constrained than the rest of the control sequences. To make them more
manageable (and constrained), for use in shell scripts, <i>xterm</i> has an
optional feature which decodes the string from hexadecimal (for setting
titles) or for encoding the title into hexadecimal when querying the
value.
</del></pre>
<h2><a name="h2-Mouse-Tracking" id="h2-Mouse-Tracking">Mouse Tracking</a></h2>
<ins block>
<p>Mouse Tracking is planned for ESPTerm, but not currently well implemented.</p>
<p>ESPTerm sends a made up sequence <code>CSI r ; c M</code> when the screen is clicked.</p>
</ins>
<pre><del>
The VT widget can be set to send the mouse position and other informa-
tion on button presses. These modes are typically used by editors and
other full-screen applications that want to make use of the mouse.
There are two sets of mutually exclusive modes:
<b>o</b> mouse protocol
<b>o</b> protocol encoding
The mouse protocols include DEC Locator mode, enabled by the DECELR CSI
<i>Ps</i> ; <i>Ps</i> ' z control sequence, and is not described here (control
sequences are summarized above). The remaining five modes of the mouse
protocols are each enabled (or disabled) by a different parameter in the
"DECSET CSI ? <i>Pm</i> h " or "DECRST CSI ? <i>Pm</i> l " control sequence.
Manifest constants for the parameter values are defined in <b>xcharmouse.h</b>
as follows:
#define SET_X10_MOUSE 9
#define SET_VT200_MOUSE 1000
#define SET_VT200_HIGHLIGHT_MOUSE 1001
#define SET_BTN_EVENT_MOUSE 1002
#define SET_ANY_EVENT_MOUSE 1003
#define SET_FOCUS_EVENT_MOUSE 1004
#define SET_EXT_MODE_MOUSE 1005
#define SET_SGR_EXT_MODE_MOUSE 1006
#define SET_URXVT_EXT_MODE_MOUSE 1015
#define SET_ALTERNATE_SCROLL 1007
The motion reporting modes are strictly <i>xterm</i> extensions, and are not
part of any standard, though they are analogous to the DEC VT200 DECELR
locator reports.
Normally, parameters (such as pointer position and button number) for
all mouse tracking escape sequences generated by <i>xterm</i> encode numeric
parameters in a single character as <i>value</i>+32. For example, ! specifies
the value 1. The upper left character position on the terminal is
denoted as 1,1. This scheme dates back to X10, though the normal mouse-
tracking (from X11) is more elaborate.
</del></pre>
<h2><a name="h2-X10-compatbility-mode" id="h2-X10-compatbility-mode">X10 compatbility mode</a></h2>
<pre><del>
X10 compatibility mode sends an escape sequence only on button press,
encoding the location and the mouse button pressed. It is enabled by
specifying parameter 9 to DECSET. On button press, <i>xterm</i> sends CSI M
<i>CbCxCy</i> (6 characters).
<b>o</b> <i>Cb</i> is button-1.
<b>o</b> <i>Cx</i> and <i>Cy</i> are the x and y coordinates of the mouse when the button was
pressed.
</del></pre>
<h2><a name="h2-Normal-tracking-mode" id="h2-Normal-tracking-mode">Normal tracking mode</a></h2>
<pre><del>
Normal tracking mode sends an escape sequence on both button press and
release. Modifier key (shift, ctrl, meta) information is also sent. It
is enabled by specifying parameter 1000 to DECSET. On button press or
release, <i>xterm</i> sends CSI M <i>CbCxCy</i>.
<b>o</b> The low two bits of <i>Cb</i> encode button information: 0=MB1 pressed, 1=MB2
pressed, 2=MB3 pressed, 3=release.
<b>o</b> The next three bits encode the modifiers which were down when the but-
ton was pressed and are added together: 4=Shift, 8=Meta, 16=Control.
Note however that the shift and control bits are normally unavailable
because <i>xterm</i> uses the control modifier with mouse for popup menus,
and the shift modifier is used in the default translations for button
events. The <i>Meta</i> modifier recognized by <i>xterm</i> is the <i>mod1</i> mask, and
is not necessarily the "Meta" key (see <i>xmodmap</i>).
<b>o</b> <i>Cx</i> and <i>Cy</i> are the x and y coordinates of the mouse event, encoded as
in X10 mode.
</del></pre>
<h2><a name="h2-Wheel-mice" id="h2-Wheel-mice">Wheel mice</a></h2>
<pre><del>
Wheel mice may return buttons 4 and 5. Those buttons are represented by
the same event codes as buttons 1 and 2 respectively, except that 64 is
added to the event code. Release events for the wheel buttons are not
reported. By default, the wheel mouse events are translated to <i>scroll-</i>
<i>back</i> and <i>scroll-forw</i> actions. Those actions normally scroll the whole
window, as if the scrollbar was used. However if Alternate Scroll mode
is set, then cursor up/down controls are sent when the terminal is dis-
playing the alternate screen. The initial state of Alternate Scroll
mode is set using the <b>alternateScroll</b> resource.
</del></pre>
<h2><a name="h2-Highlight-tracking" id="h2-Highlight-tracking">Highlight tracking</a></h2>
<pre><del>
Mouse highlight tracking notifies a program of a button press, receives
a range of lines from the program, highlights the region covered by the
mouse within that range until button release, and then sends the program
the release coordinates. It is enabled by specifying parameter 1001 to
DECSET. Highlighting is performed only for button 1, though other but-
ton events can be received.
<b>Warning:</b> use of this mode requires a cooperating program or it will hang
<i>xterm.</i>
On button press, the same information as for normal tracking is gener-
ated; <i>xterm</i> then waits for the program to send mouse tracking informa-
tion. <i>All</i> <i>X</i> <i>events</i> <i>are</i> <i>ignored</i> <i>until</i> <i>the</i> <i>proper</i> <i>escape</i> <i>sequence</i> <i>is</i>
<i>received</i> <i>from</i> <i>the</i> <i>pty:</i> CSI <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> ; <i>Ps</i> T . The parameters
are <i>func,</i> <i>startx,</i> <i>starty,</i> <i>firstrow,</i> and <i>lastrow.</i> <i>func</i> is non-zero to
initiate highlight tracking and zero to abort. <i>startx</i> and <i>starty</i> give
the starting x and y location for the highlighted region. The ending
location tracks the mouse, but will never be above row <i>firstrow</i> and will
always be above row <i>lastrow.</i> (The top of the screen is row 1.) When
the button is released, <i>xterm</i> reports the ending position one of two
ways:
<b>o</b> if the start and end coordinates are the same locations:
CSI t <i>CxCy</i>.
<b>o</b> otherwise:
CSI T <i>CxCyCxCyCxCy</i>.
The parameters are <i>startx,</i> <i>starty,</i> <i>endx,</i> <i>endy,</i> <i>mousex,</i> and <i>mousey.</i>
- <i>startx,</i> <i>starty,</i> <i>endx,</i> and <i>endy</i> give the starting and ending charac-
ter positions of the region.
- <i>mousex</i> and <i>mousey</i> give the location of the mouse at button up, which
may not be over a character.
</del></pre>
<h2><a name="h2-Button-event-tracking" id="h2-Button-event-tracking">Button-event tracking</a></h2>
<pre><del>
Button-event tracking is essentially the same as normal tracking, but
<i>xterm</i> also reports button-motion events. Motion events are reported
only if the mouse pointer has moved to a different character cell. It
is enabled by specifying parameter 1002 to DECSET. On button press or
release, <i>xterm</i> sends the same codes used by normal tracking mode.
<b>o</b> On button-motion events, <i>xterm</i> adds 32 to the event code (the third
character, <i>Cb</i>).
<b>o</b> The other bits of the event code specify button and modifier keys as
in normal mode. For example, motion into cell x,y with button 1 down
is reported as CSI M @ <i>CxCy</i>. ( @ = 32 + 0 (button 1) + 32 (motion
indicator) ). Similarly, motion with button 3 down is reported as CSI
M B <i>CxCy</i>. ( B = 32 + 2 (button 3) + 32 (motion indicator) ).
</del></pre>
<h2><a name="h2-Any-event-tracking" id="h2-Any-event-tracking">Any-event tracking</a></h2>
<pre><del>
Any-event mode is the same as button-event mode, except that all motion
events are reported, even if no mouse button is down. It is enabled by
specifying 1003 to DECSET.
</del></pre>
<h2><a name="h2-FocusIn_FocusOut" id="h2-FocusIn_FocusOut">FocusIn/FocusOut</a></h2>
<pre><del>
FocusIn/FocusOut can be combined with any of the mouse events since it
uses a different protocol. When set, it causes <i>xterm</i> to send CSI I
when the terminal gains focus, and CSI O when it loses focus.
</del></pre>
<h2><a name="h2-Extended-coordinates" id="h2-Extended-coordinates">Extended coordinates</a></h2>
<pre><del>
The original X10 mouse protocol limits the <i>Cx</i> and <i>Cy</i> ordinates to 223
(=255 - 32). <i>Xterm</i> supports more than one scheme for extending this
range, by changing the protocol encoding:
UTF-8 (1005)
This enables UTF-8 encoding for <i>Cx</i> and <i>Cy</i> under all tracking
modes, expanding the maximum encodable position from 223 to
2015. For positions less than 95, the resulting output is
identical under both modes. Under extended mouse mode, posi-
tions greater than 95 generate "extra" bytes which will con-
fuse applications which do not treat their input as a UTF-8
stream. Likewise, <i>Cb</i> will be UTF-8 encoded, to reduce confu-
sion with wheel mouse events.
Under normal mouse mode, positions outside (160,94) result in
byte pairs which can be interpreted as a single UTF-8 charac-
ter; applications which do treat their input as UTF-8 will
almost certainly be confused unless extended mouse mode is
active.
This scheme has the drawback that the encoded coordinates will
not pass through <i>luit</i> unchanged, e.g., for locales using non-
UTF-8 encoding.
SGR (1006)
The normal mouse response is altered to use CSI &lt; followed by
semicolon-separated encoded button value, the <i>Cx</i> and <i>Cy</i> ordi-
nates and a final character which is M for button press and m
for button release.
<b>o</b> The encoded button value in this case does not add 32 since
that was useful only in the X10 scheme for ensuring that the
byte containing the button value is a printable code.
<b>o</b> The modifiers are encoded in the same way.
<b>o</b> A different final character is used for button release to
resolve the X10 ambiguity regarding which button was
released.
The highlight tracking responses are also modified to an SGR-
like format, using the same SGR-style scheme and button-encod-
ings.
URXVT (1015)
The normal mouse response is altered to use CSI followed by
semicolon-separated encoded button value, the <i>Cx</i> and <i>Cy</i> ordi-
nates and final character M .
This uses the same button encoding as X10, but printing it as
a decimal integer rather than as a single byte.
However, CSI M can be mistaken for DL (delete lines), while
the highlight tracking CSI T can be mistaken for SD (scroll
down), and the Window manipulation controls. For these rea-
sons, the 1015 control is not recommended; it is not an
improvement over 1005.
</del></pre>
<h2><a name="h2-Sixel-Graphics" id="h2-Sixel-Graphics">Sixel Graphics</a></h2>
<pre><del>
If <i>xterm</i> is configured as VT240, VT241, VT330, VT340 or VT382 using the
<b>decTerminalID</b> resource, it supports Sixel Graphics controls, a palleted
bitmap graphics system using sets of six vertical pixels as the basic
element.
CSI <i>Ps</i> c <i>xterm</i> responds to Send Device Attributes (Primary DA) with
these additional codes:
<i>Ps</i> = 4 -&gt; Sixel graphics.
CSI ? <i>Pm</i> h
<i>xterm</i> has these additional private Set Mode values:
<i>Ps</i> = 8 0 -&gt; Sixel scrolling.
<i>Ps</i> = 1 0 7 0 -&gt; use private color registers for each
graphic.
<i>Ps</i> = 8 4 5 2 -&gt; Sixel scrolling leaves cursor to right of
graphic.
DCS <i>Pa</i>; <i>Pb</i>; <i>Ph</i> q <i>Ps</i>..<i>Ps</i> <i>ST</i>
See:
http://vt100.net/docs/vt3xx-gp/chapter14.html
The sixel data device control string has three positional
parameters, following the q with sixel data.
<i>Pa</i> -&gt; pixel aspect ratio
<i>Pb</i> -&gt; background color option
<i>Ph</i> -&gt; horizontal grid size (ignored).
<i>Ps</i> -&gt; sixel data
</del></pre>
<h2><a name="h2-ReGIS-Graphics" id="h2-ReGIS-Graphics">ReGIS Graphics</a></h2>
<pre><del>
If <i>xterm</i> is configured as VT125, VT240, VT241, VT330 or VT340 using the
<b>decTerminalID</b> resource, it supports Remote Graphic Instruction Set, a
graphics description language.
CSI <i>Ps</i> c <i>xterm</i> responds to Send Device Attributes (Primary DA) with
these additional codes:
<i>Ps</i> = 3 -&gt; ReGIS graphics.
CSI ? <i>Pm</i> h
<i>xterm</i> has these additional private Set Mode values:
<i>Ps</i> = 1 0 7 0 -&gt; use private color registers for each
graphic.
DCS <i>Pm</i> p <i>Pr</i>..<i>Pr</i> <i>ST</i>
See:
http://vt100.net/docs/vt3xx-gp/chapter1.html
The ReGIS data device control string has one positional param-
eter with four possible values:
<i>Pm</i> = 0 -&gt; resume command, use fullscreen mode.
<i>Pm</i> = 1 -&gt; start new command, use fullscreen mode.
<i>Pm</i> = 2 -&gt; resume command, use command display mode.
<i>Pm</i> = 3 -&gt; start new command, use command display mode.
</del></pre>
<h2><a name="h2-Tektronix-4014-Mode" id="h2-Tektronix-4014-Mode">Tektronix 4014 Mode</a></h2>
<pre><del>
Most of these sequences are standard Tektronix 4014 control sequences.
Graph mode supports the 12-bit addressing of the Tektronix 4014. The
major features missing are the write-through and defocused modes. This
document does not describe the commands used in the various Tektronix
plotting modes but does describe the commands to switch modes.
BEL Bell (Ctrl-G).
BS Backspace (Ctrl-H).
TAB Horizontal Tab (Ctrl-I).
LF Line Feed or New Line (Ctrl-J).
VT Cursor up (Ctrl-K).
FF Form Feed or New Page (Ctrl-L).
CR Carriage Return (Ctrl-M).
ESC ETX Switch to VT100 Mode (ESC Ctrl-C).
ESC ENQ Return Terminal Status (ESC Ctrl-E).
ESC FF PAGE (Clear Screen) (ESC Ctrl-L).
ESC SO Begin 4015 APL mode (ESC Ctrl-N). (This is ignored by
<i>xterm</i>).
ESC SI End 4015 APL mode (ESC Ctrl-O). (This is ignored by <i>xterm</i>).
ESC ETB COPY (Save Tektronix Codes to file COPY<i>yyyy-mm-dd.hh:mm:ss</i>).
ETB (end transmission block) is the same as Ctrl-W.
ESC CAN Bypass Condition (ESC Ctrl-X).
ESC SUB GIN mode (ESC Ctrl-Z).
ESC FS Special Point Plot Mode (ESC Ctrl-\).
ESC 8 Select Large Character Set.
ESC 9 Select #2 Character Set.
ESC : Select #3 Character Set.
ESC ; Select Small Character Set.
OSC <i>Ps</i> ; <i>Pt</i> BEL
Set Text Parameters of VT window.
<i>Ps</i> = 0 -&gt; Change Icon Name and Window Title to <i>Pt</i>.
<i>Ps</i> = 1 -&gt; Change Icon Name to <i>Pt</i>.
<i>Ps</i> = 2 -&gt; Change Window Title to <i>Pt</i>.
<i>Ps</i> = 4 6 -&gt; Change Log File to <i>Pt</i>. (This is normally dis-
abled by a compile-time option).
ESC ` Normal Z Axis and Normal (solid) Vectors.
ESC a Normal Z Axis and Dotted Line Vectors.
ESC b Normal Z Axis and Dot-Dashed Vectors.
ESC c Normal Z Axis and Short-Dashed Vectors.
ESC d Normal Z Axis and Long-Dashed Vectors.
ESC h Defocused Z Axis and Normal (solid) Vectors.
ESC i Defocused Z Axis and Dotted Line Vectors.
ESC j Defocused Z Axis and Dot-Dashed Vectors.
ESC k Defocused Z Axis and Short-Dashed Vectors.
ESC l Defocused Z Axis and Long-Dashed Vectors.
ESC p Write-Thru Mode and Normal (solid) Vectors.
ESC q Write-Thru Mode and Dotted Line Vectors.
ESC r Write-Thru Mode and Dot-Dashed Vectors.
ESC s Write-Thru Mode and Short-Dashed Vectors.
ESC t Write-Thru Mode and Long-Dashed Vectors.
FS Point Plot Mode (Ctrl-\).
GS Graph Mode (Ctrl-]).
RS Incremental Plot Mode (Ctrl-^).
US Alpha Mode (Ctrl-_).
</del></pre>
<h2><a name="h2-VT52-Mode" id="h2-VT52-Mode">VT52 Mode</a></h2>
<pre><del>
Parameters for cursor movement are at the end of the ESC Y escape
sequence. Each ordinate is encoded in a single character as <i>value</i>+32.
For example, ! is 1. The screen coordinate system is 0-based.
ESC &lt; Exit VT52 mode (Enter VT100 mode).
ESC = Enter alternate keypad mode.
ESC &gt; Exit alternate keypad mode.
ESC A Cursor up.
ESC B Cursor down.
ESC C Cursor right.
ESC D Cursor left.
ESC F Enter graphics mode.
ESC G Exit graphics mode.
ESC H Move the cursor to the home position.
ESC I Reverse line feed.
ESC J Erase from the cursor to the end of the screen.
ESC K Erase from the cursor to the end of the line.
ESC Y <i>Ps</i> <i>Ps</i>
Move the cursor to given row and column.
ESC Z Identify.
-&gt; ESC / Z ("I am a VT52.").
</del></pre>
<div class="nav">
<ul>
<li><a href="#top" class="nav-top">(top)</a><br>
<li><a href="#h2-Definitions">Definitions</a></li>
<li><a href="#h2-Control-Bytes_-Characters_-and-Sequences">Control Bytes, Characters, and Sequences</a></li>
<li><a href="#h2-C1-_8-Bit_-Control-Characters">C1 (8-Bit) Control Characters</a></li>
<li><a href="#h2-VT100-Mode">VT100 Mode</a></li>
<li><a href="#h2-Single-character-functions">Single-character functions</a></li>
<li><a href="#h2-Controls-beginning-with-ESC">Controls beginning with ESC</a></li>
<li><a href="#h2-Application-Program-Command-functions"><del>Application Program-Command functions</del></a></li>
<li><a href="#h2-Device-Control-functions">Device-Control functions</a></li>
<li><a href="#h2-Functions-using-CSI-_-ordered-by-the-final-character_s_">Functions using CSI , ordered by the final character(s)</a></li>
<li><a href="#h2-Operating-System-Commands">Operating System Commands</a></li>
<li><a href="#h2-Privacy-Message"><del>Privacy Message</del></a></li>
<li><a href="#h2-Alt-and-Meta-Keys"><del>Alt and Meta Keys</del></a></li>
<li><a href="#h2-PC-Style-Function-Keys">PC-Style Function Keys</a></li>
<li><a href="#h2-VT220-Style-Function-Keys"><del>VT220-Style Function Keys</del></a></li>
<li><a href="#h2-VT52-Style-Function-Keys"><del>VT52-Style Function Keys</del></a></li>
<li><a href="#h2-Sun-Style-Function-Keys"><del>Sun-Style Function Keys</del></a></li>
<li><a href="#h2-HP-Style-Function-Keys"><del>HP-Style Function Keys</del></a></li>
<li><a href="#h2-The-Alternate-Screen-Buffer"><del>The Alternate Screen Buffer</del></a></li>
<li><a href="#h2-Bracketed-Paste-Mode"><del>Bracketed Paste Mode</del></a></li>
<li><a href="#h2-Title-Modes">Title Modes</a></li>
<li><a href="#h2-Mouse-Tracking">Mouse Tracking</a></li>
<li><a href="#h2-X10-compatbility-mode"><del>X10 compatbility mode</del></a></li>
<li><a href="#h2-Normal-tracking-mode"><del>Normal tracking mode</del></a></li>
<li><a href="#h2-Wheel-mice"><del>Wheel mice</del></a></li>
<li><a href="#h2-Highlight-tracking"><del>Highlight tracking</del></a></li>
<li><a href="#h2-Button-event-tracking"><del>Button-event tracking</del></a></li>
<li><a href="#h2-Any-event-tracking"><del>Any-event tracking</del></a></li>
<li><a href="#h2-FocusIn_FocusOut"><del>FocusIn/FocusOut</del></a></li>
<li><a href="#h2-Extended-coordinates"><del>Extended coordinates</del></a></li>
<li><a href="#h2-Sixel-Graphics"><del>Sixel Graphics</del></a></li>
<li><a href="#h2-ReGIS-Graphics"><del>ReGIS Graphics</del></a></li>
<li><a href="#h2-Tektronix-4014-Mode"><del>Tektronix 4014 Mode</del></a></li>
<li><a href="#h2-VT52-Mode"><del>VT52 Mode</del></a></li>
</ul>
</div>
</body>
</html>