"Xterm Control Sequences" document
$XTermId: ctlseqs.ms,v 1.635 2021/11/11 20:31:02 tom Exp $
Copyright 1996-2020,2021 by Thomas E. Dickey
All Rights Reserved
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization.
Copyright 1991, 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
X Window System is a trademark of X Consortium, Inc.
Originally written by Edward Moy, University of California,
Berkeley, edmoy@violet.berkeley.edu, for the X.V10R4 xterm.
The X Consortium staff has since updated it for X11.
Updated by Thomas E. Dickey for XFree86 3.2 - XFree86 4.3, and afterward.
Run this file through troff and use the -ms macro package.
.ND Start a list of controls
.nr pD \\n[PD] .nr PD 0 .nr PI 1.0i .nr VS 16 .. End a list of controls
.nr PD \\n[pD] .nr VS 12
..
Bulleted paragraph
..
Normal leading paragraph
..
Filler before ".IP" (how to pass parameters to that?)
..
Normal internal paragraph
..
Section header
.iP
.iP
\\$*
..
Escape single quotes in literal strings from groff's Unicode transform.
.nr s 6*\n(PS/10
space between chars
.nr [W \w'\*L'u
.nr w \w'\*E'u
.nr w \w'\*T'u
.nr w \w'\*X'u
.nr w \w'\*N'u
.nr w \w'\*(ET'u
.nr w \w'\*C'u
.nr w \w'\*S'u
.nr [W +\w'\|\|'u
.nr w \w'\\$2'
.nr H \\n([Wu-\\nwu
.nr h \\nHu/2u
do fancy box in troff
..
.[] Et \v'-1p'\*X\v'1p'
.[] En \v'-1p'\*N\v'1p'
.[] Be \v'-1p'\*L\v'1p'
.[] AP \v'-1p'\s\nsAPC\s0\v'1p'
.[] Bs \v'-1p'\s\nsBS\s0\v'1p'
.[] Cs \v'-1p'\s\nsCSI\s0\v'1p'
.[] S2 \v'-1p'\s\nsSS2\s0\v'1p'
.[] S3 \v'-1p'\s\nsSS3\s0\v'1p'
.[] SS \v'-1p'\s\nsSOS\s0\v'1p'
.[] Eg \v'-1p'\s\nsEPA\s0\v'1p'
.[] Sg \v'-1p'\s\nsSPA\s0\v'1p'
.[] Dc \v'-1p'\s\nsDCS\s0\v'1p'
.[] Ht \v'-1p'\s\nsHTS\s0\v'1p'
.[] Id \v'-1p'\s\nsIND\s0\v'1p'
.[] Nl \v'-1p'\s\nsNEL\s0\v'1p'
.[] Os \v'-1p'\s\nsOSC\s0\v'1p'
.[] RI \v'-1p'\s\nsRI\s0\v'1p'
.[] PM \v'-1p'\s\nsPM\s0\v'1p'
.[] ST \v'-1p'\s\nsST\s0\v'1p'
.[] Ta \v'-1p'\*T\v'1p'
.[] Lf \v'-1p'\s\nsLF\s0\v'1p'
.[] Vt \v'-1p'\s\nsVT\s0\v'1p'
.[] Ff \v'-1p'\s\nsFF\s0\v'1p'
.[] Np \v'-1p'\s\nsNP\s0\v'1p'
.[] Cr \v'-1p'\s\nsCR\s0\v'1p'
.[] So \v'-1p'\s\nsSO\s0\v'1p'
.[] Sp \v'-1p'\s\nsSP\s0\v'1p'
.[] Si \v'-1p'\s\nsSI\s0\v'1p'
.[] Eb \v'-1p'\*(ET\v'1p'
.[] Ca \v'-1p'\*C\v'1p'
.[] Su \v'-1p'\*S\v'1p'
.[] Es \v'-1p'\*E\v'1p'
.[] Fs \v'-1p'\s\nsFS\s0\v'1p'
.[] Gs \v'-1p'\s\nsGS\s0\v'1p'
.[] Rs \v'-1p'\s\nsRS\s0\v'1p'
.[] Us \v'-1p'\s\nsUS\s0\v'1p'
.[] XX \v'-1p'\s\nsXX\s0\v'1p'
.[] $ $
.[] # #
.[] % %
.[] (( (
.[] ) )
.[] * *
.[] + +
.[] , ,
.[] - -
.[] . .
.[] 0 0
.[] 1 1
.[] 2 2
.[] 3 3
.[] 4 4
.[] 5 5
.[] 6 6
.[] 7 7
.[] 8 8
.[] 9 9
.[] : :
.[] ; ;
.[] = =
.[] / /
.[] < <
.[] > >
.[] ? ?
.[] @ @
.[] A A
.[] cB B
.[] C C
.[] D D
.[] E E
.[] F F
.[] G G
.[] H H
.[] I I
.[] J J
.[] K K
.[] L L
.[] M M
.[] N N
.[] O O
.[] P P
.[] Q Q
.[] R R
.[] S S
.[] T T
.[] V V
.[] W W
.[] XX X
.[] Y Y
.[] Z Z
.[] [[ [
.[] ]] ]
.[] bS \\e
.[] { {
.[] ~ \(ti
.[] Dq \(dq
.[] & &
.[] ^ \(ha
.[] _ _
.[] qu \(aq
.[] ` \`
.[] a a
.[] b b
.[] c c
.[] d d
.[] e e
.[] f f
.[] g g
.[] h h
.[] i i
.[] j j
.[] k k
.[] l l
.[] m m
.[] n n
.[] o o
.[] p p
.[] q q
.[] r r
.[] cs s
.[] t t
.[] u u
.[] v v
.[] w w
.[] x x
.[] y y
.[] z z
.[] | |
.[] } }
.[] ! !
Many controls use parameters, shown in italics.
If a control uses a single parameter, only one parameter name is listed.
Some parameters (along with separating \*; characters) may be optional.
Other characters in the control are required.
.iP
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 graphic characters. 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: .bP 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 continuation bytes of a UTF-8 encoded (multibyte) value. .bP It is not possible to use a C1 control obtained from decoding the UTF-8 text, because that would require reprocessing the data. Consequently there is no ambiguity in the way this document uses the term \*(``character\*('' to refer to bytes in a control sequence.
The order of processing is a necessary consequence of the way ECMA-48 is designed: .bP Each byte sent to the terminal can be unambiguously determined to fall into one of a few categories (C0, C1 and graphic characters). .bP ECMA-48 is modal; 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. .bP 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. .bP 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. .bP 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 functions 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. .bP Some controls (such as \*(Os) introduce a string mode, which is ended on a \*(ST (string terminator). ECMA-48 describes only correct behavior, telling what types of characters are expected at each stage of the control sequences. It says that the action taken in error recovery is implementation-dependent. \*(XT decodes control sequences using a state machine. It handles errors in decoding i.e., unexpected characters, by resetting to the initial (ground) state. That is different from the treatment of unimplemented (but correctly formatted) features. If an application does not send the string terminator, that is also an error from the standpoint of a user. To accommodate users of those applications, \*(xt has resource settings which allow workarounds:.bP The Linux console's palette sequences do not use a string terminator. The brokenLinuxOSC resource setting tells \*(xt to ignore those particular sequences. .bP The terminal should accept single-byte controls within the string. But some applications omit a string terminator, like the Linux console. The brokenStringTerm resource setting tells \*(xt to exit string mode if it decodes a common control character such as carriage return before the string terminator.
The \*(xt 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 equivalent: .St
These control characters are used in the vtXXX emulation. . .Ss "VT100-related terminals"
In this document, \*(``VT100\*('' refers not only to VT100/VT102, but also to the succession of upward-compatible terminals produced by DEC (Digital Equipment Corporation) from the mid-1970s for about twenty years. For brevity, the document refers to the related models: \*(``VT200\*('' as VT220/VT240, \*(``VT300\*('' as VT320/VT340, \*(``VT400\*('' as VT420, and \*(``VT500\*('' as VT510/VT520/VT525.
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 ECMA-48 and aixterm color controls. The only VT102 feature not supported is auto-repeat, since the only way X provides for this will affect all windows.
There are additional control sequences to provide \*(xt-dependent functions, such as the scrollbar or window size. Where the function is specified by DEC or ECMA-48, the mnemonic assigned to it is given in parentheses.
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; \*(xt can be configured and built without support for them. . .Sh "VT100 Mode" .Ss Single-character functions .St
VT200 and up implement LS0. . .iP
VT200 and up implement LS1. . .iP
This excludes controls where \*(Es is part of a 7-bit equivalent to 8-bit C1 controls, ordered by the final character(s). .St
Final character \*(Cc for designating 94-character sets. In this list,
.bP \*0, \*A and \*(cB were introduced in the VT100, .bP most were introduced in the VT200 series, .bP a few were introduced in the VT300 series, and .bP a few more were introduced in the VT500 series.
The VT220 character sets, together with a few others (such as Portuguese) are activated by the National Replacement Character Set (NRCS) controls. The term \*(``replacement\*('' says that the character set is formed by replacing some of the characters in a set (termed the Multinational Character Set) with more useful ones for a given language. The ASCII and DEC Supplemental character sets make up the two halves of the Multinational Character set, initially mapped to GL and GR.
The valid final characters \*(Cc for this control are: \*(Cc = \*A \(-> United Kingdom (UK), VT100. \*(Cc = \*(cB \(-> United States (USASCII), VT100. \*(Cc = \*C or \*5 \(-> Finnish, VT200. \*(Cc = \*H or \*7 \(-> Swedish, VT200. \*(Cc = \*K \(-> German, VT200. \*(Cc = \*Q or \*9 \(-> French Canadian, VT200. \*(Cc = \*R or \*f \(-> French, VT200. \*(Cc = \*Y \(-> Italian, VT200. \*(Cc = \*Z \(-> Spanish, VT200. \*(Cc = \*4 \(-> Dutch, VT200. \*(Cc = \*(Dq\*> \(-> Greek, VT500. \*(Cc = \*%\*2 \(-> Turkish, VT500. \*(Cc = \*%\*6 \(-> Portuguese, VT300. \*(Cc = \*%\*= \(-> Hebrew, VT500. \*(Cc = \*= \(-> Swiss, VT200. \*(Cc = \*`, \*E or \*6 \(-> Norwegian/Danish, VT200.
The final character \*A is a special case, since the same final character is used by the VT300-control for the 96-character British Latin-1.
There are a few other 94-character sets: \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set, VT100. \*(Cc = \*< \(-> DEC Supplemental, VT200. \*(Cc = \*> \(-> DEC Technical, VT300.
These are documented as 94-character sets (like USASCII) without NRCS: \*(Cc = \*(Dq\*4 \(-> DEC Hebrew, VT500. \*(Cc = \*(Dq\*? \(-> DEC Greek, VT500. \*(Cc = \*%\*0 \(-> DEC Turkish, VT500. \*(Cc = \*%\*5 \(-> DEC Supplemental Graphics, VT300. \*(Cc = \*&\*4 \(-> DEC Cyrillic, VT500.
The VT520 reference manual lists a few more, but no documentation has been found for the mappings: \*(Cc = \*%\*3 \(-> SCS NRCS, VT500. \*(Cc = \*&\*5 \(-> DEC Russian, VT500. .iP
The same character sets apply as for \*(Es\*(((\*(Cc. . .iP
The same character sets apply as for \*(Es\*(((\*(Cc. . .iP
The same character sets apply as for \*(Es\*(((\*(Cc. . .iP
These controls apply only to 96-character sets. Unlike the 94-character sets, these can have different values than ASCII space and DEL for the mapping of 0x20 and 0x7f. The valid final characters \*(Cc for this control are: \*(Cc = \*A \(-> ISO Latin-1 Supplemental, VT300. \*(Cc = \*(cB \(-> ISO Latin-2 Supplemental, VT500. \*(Cc = \*F \(-> ISO Greek Supplemental, VT500. \*(Cc = \*H \(-> ISO Hebrew Supplemental, VT500. \*(Cc = \*L \(-> ISO Latin-Cyrillic, VT500. \*(Cc = \*M \(-> ISO Latin-5 Supplemental, VT500. . .iP
The same character sets apply as for \*(Es\*-\*(Cc. . .iP
The same character sets apply as for \*(Es\*-\*(Cc. . .iP
.Ss Device-Control functions .St
The string following the \*(``q\*('' is one of the following: \*m \(-> SGR \*(Dq\*p \(-> DECSCL \*(Sp\*q \(-> DECSCUSR \*(Dq\*q \(-> DECSCA \*r \(-> DECSTBM \*(cs \(-> DECSLRM \*t \(-> DECSLPP \*$\*| \(-> DECSCPP \**\*| \(-> DECSNLS
\*(xt responds with \*(Dc\*1\*$\*r\*(Pt\*s\*(ST for valid requests, replacing the \*(Pt with the corresponding \*(Cs string, or \*(Dc\*0\*$\*r\*(Pt\*s\*(ST for invalid requests. .iP
\*(Dc\*1\*+\*R\*(Pt\*s\*(ST for valid requests, adding to \*(Pt an \*=, and the value of the corresponding resource that \*(xt is using, or
\*(Dc\*0\*+\*R\*(Pt\*s\*(ST for invalid requests.
The strings are encoded in hexadecimal (2 digits per character). .Ed . .iP
A few special features are also recognized, which are not key names:
.bP Co for termcap colors (or colors for terminfo colors), and .bP TN for termcap name (or name for terminfo name). .bP RGB for the ncurses direct-color extension.
Only a terminfo name is provided, since termcap applications cannot use this information.
\*(Dc\*1\*+\*r\*(Pt\*s\*(ST for valid requests, adding to \*(Pt an \*=, and the value of the corresponding string that \*(xt would send, or
\*(Dc\*0\*+\*r\*(Pt\*s\*(ST for invalid requests.
The strings are encoded in hexadecimal (2 digits per character).
.Ed
.Ss Functions using \*(Cs, ordered by the final character(s)
.St
.bP The current implementation allows reading the graphics sizes, but disallows modifying those sizes because that is done once, using resource-values. .bP Graphics geometry is not necessarily the same as \*(``window size\*('' (see the dtterm window manipulation extensions). \*(XT limits the maximum graphics geometry according to the maxGraphicSize resource.
The maxGraphicSize resource can be either an explicit heightxwidth (default: 1000x1000 as of version 328) or the word \*(``auto\*('' (telling \*(XT to use limits the decGraphicsID or decTerminalID resource to determine the limits). .bP \*(XT uses the minimum of the window size and the graphic size to obtain the maximum geometry. .bP While resizing a window will always change the current graphics geometry, the reverse is not true. Setting graphics geometry does not affect the window size. .bP If \*(xt is able to support graphics (compile-time), but is not configured (runtime) for graphics, these responses will indicate a failure. Other implementations which do not use the maximum graphics dimensions but are configured for graphics should report zeroes for the maximum geometry rather than a failure.This was a publication error in the original ECMA-48 5th edition (1991) corrected in 2003. . .iP
where \*(Pp denotes the terminal type \*(Pp = \*0 \(-> \*(``VT100\*(''. \*(Pp = \*1 \(-> \*(``VT220\*(''. \*(Pp = \*2 \(-> \*(``VT240\*('' or \*(``VT241\*(''. \*(Pp = \*1\*8 \(-> \*(``VT330\*(''. \*(Pp = \*1\*9 \(-> \*(``VT340\*(''. \*(Pp = \*2\*4 \(-> \*(``VT320\*(''. \*(Pp = \*3\*2 \(-> \*(``VT382\*(''. \*(Pp = \*4\*1 \(-> \*(``VT420\*(''. \*(Pp = \*6\*1 \(-> \*(``VT510\*(''. \*(Pp = \*6\*4 \(-> \*(``VT520\*(''. \*(Pp = \*6\*5 \(-> \*(``VT525\*(''. .iP and \*(Pv is the firmware version (for \*(xt, this was originally the XFree86 patch number, starting with 95). In a DEC terminal, \*(Pc indicates the ROM cartridge registration number and is always zero. . .iP
This appears as Bold in X11R6 xterm. \*(Ps = \*7 \(-> Inverse, VT100. \*(Ps = \*8 \(-> Invisible, i.e., hidden, ECMA-48 2nd, VT300. \*(Ps = \*9 \(-> Crossed-out characters, ECMA-48 3rd. \*(Ps = \*2\*1 \(-> Doubly-underlined, ECMA-48 3rd. \*(Ps = \*2\*2 \(-> Normal (neither bold nor faint), ECMA-48 3rd. \*(Ps = \*2\*3 \(-> Not italicized, ECMA-48 3rd. \*(Ps = \*2\*4 \(-> Not underlined, ECMA-48 3rd. \*(Ps = \*2\*5 \(-> Steady (not blinking), ECMA-48 3rd. \*(Ps = \*2\*7 \(-> Positive (not inverse), ECMA-48 3rd. \*(Ps = \*2\*8 \(-> Visible, i.e., not hidden, ECMA-48 3rd, VT300. \*(Ps = \*2\*9 \(-> Not crossed-out, ECMA-48 3rd. \*(Ps = \*3\*0 \(-> Set foreground color to Black. \*(Ps = \*3\*1 \(-> Set foreground color to Red. \*(Ps = \*3\*2 \(-> Set foreground color to Green. \*(Ps = \*3\*3 \(-> Set foreground color to Yellow. \*(Ps = \*3\*4 \(-> Set foreground color to Blue. \*(Ps = \*3\*5 \(-> Set foreground color to Magenta. \*(Ps = \*3\*6 \(-> Set foreground color to Cyan. \*(Ps = \*3\*7 \(-> Set foreground color to White. \*(Ps = \*3\*9 \(-> Set foreground color to default, ECMA-48 3rd. \*(Ps = \*4\*0 \(-> Set background color to Black. \*(Ps = \*4\*1 \(-> Set background color to Red. \*(Ps = \*4\*2 \(-> Set background color to Green. \*(Ps = \*4\*3 \(-> Set background color to Yellow. \*(Ps = \*4\*4 \(-> Set background color to Blue. \*(Ps = \*4\*5 \(-> Set background color to Magenta. \*(Ps = \*4\*6 \(-> Set background color to Cyan. \*(Ps = \*4\*7 \(-> Set background color to White. \*(Ps = \*4\*9 \(-> Set background color to default, ECMA-48 3rd. .sP Some of the above note the edition of ECMA-48 which first describes a feature. In its successive editions from 1979 to 1991 (2nd 1979, 3rd 1984, 4th 1986, and 5th 1991), ECMA-48 listed codes through \*6\*5 (skipping several toward the end of the range). Most of the ECMA-48 codes not implemented in \*(xt were never implemented in a hardware terminal. Several (such as \*3\*9 and \*4\*9) are either noted in ECMA-48 as implementation defined, or described in vague terms. .sP The successive editions of ECMA-48 give little attention to changes from one edition to the next, except to comment on features which have become obsolete. ECMA-48 1st (1976) is unavailable; there is no reliable source of information which states whether \*(``ANSI\*('' color was defined in that edition, or later (1979). The VT100 (1978) implemented the most commonly used non-color video attributes which are given in the 2nd edition. .sP While 8-color support is described in ECMA-48 2nd edition, the VT500 series (introduced in 1993) were the first DEC terminals implementing \*(``ANSI\*('' color. The DEC terminal's use of color is known to differ from \*(xt; useful documentation on this series became available too late to influence \*(xt. .sP If 16-color support is compiled, the following aixterm controls apply. Assume that \*(xt's resources are set so that the ISO color codes are the first 8 of a set of 16. Then the aixterm colors are the bright versions of the ISO colors: .iP \*(Ps = \*9\*0 \(-> Set foreground color to Black. \*(Ps = \*9\*1 \(-> Set foreground color to Red. \*(Ps = \*9\*2 \(-> Set foreground color to Green. \*(Ps = \*9\*3 \(-> Set foreground color to Yellow. \*(Ps = \*9\*4 \(-> Set foreground color to Blue. \*(Ps = \*9\*5 \(-> Set foreground color to Magenta. \*(Ps = \*9\*6 \(-> Set foreground color to Cyan. \*(Ps = \*9\*7 \(-> Set foreground color to White. \*(Ps = \*1\*0\*0 \(-> Set background color to Black. \*(Ps = \*1\*0\*1 \(-> Set background color to Red. \*(Ps = \*1\*0\*2 \(-> Set background color to Green. \*(Ps = \*1\*0\*3 \(-> Set background color to Yellow. \*(Ps = \*1\*0\*4 \(-> Set background color to Blue. \*(Ps = \*1\*0\*5 \(-> Set background color to Magenta. \*(Ps = \*1\*0\*6 \(-> Set background color to Cyan. \*(Ps = \*1\*0\*7 \(-> Set background color to White. .sP If \*(xt is compiled with the 16-color support disabled, it supports the following, from rxvt: \*(Ps = \*1\*0\*0 \(-> Set foreground and background color to default. .sP \*(XT 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:
.bP All parameters are decimal integers. .bP RGB values range from zero (0) to 255. .bP The 88- and 256-color support uses subparameters described in ISO-8613-6 for indexed color. ISO-8613-6 also mentions direct color, using a similar scheme. \*(xt supports that, too. .bP \*(xt allows either colons (standard) or semicolons (legacy) to separate the subparameters (but after the first colon, colons must be used).
Can I set a color by its number? .sP These ISO-8613-6 controls (marked in ECMA-48 5th edition as \*(``reserved for future standardization\*('') are supported by \*(xt: \*(Ps = \*3\*8\*:\*2\*:\*(Pi\*s\*:\*(Pr\*s\*:\*(Pg\*s\*:\*(Pb \(-> Set foreground color using RGB values. If \*(xt is not compiled with direct-color support, it uses the closest match in its palette for the given RGB \*(Pr/\*(Pg/\*(Pb. The color space identifier \*(Pi is ignored. \*(Ps = \*3\*8\*:\*5\*:\*(Ps \(-> Set foreground color to \*(Ps, using indexed color. \*(Ps = \*4\*8\*:\*2\*:\*(Pi\*s\*:\*(Pr\*s\*:\*(Pg\*s\*:\*(Pb \(-> Set background color using RGB values. If \*(xt is not compiled with direct-color support, it uses the closest match in its palette for the given RGB \*(Pr/\*(Pg/\*(Pb. The color space identifier \*(Pi is ignored. \*(Ps = \*4\*8\*:\*5\*:\*(Ps \(-> Set background color to \*(Ps, using indexed color. .sP This variation on ISO-8613-6 is supported for compatibility with KDE konsole: \*(Ps = \*3\*8\*;\*2\*;\*(Pr\*s\*;\*(Pg\*s\*;\*(Pb \(-> Set foreground color using RGB values. If \*(xt is not compiled with direct-color support, it uses the closest match in its palette for the given RGB \*(Pr/\*(Pg/\*(Pb. \*(Ps = \*4\*8\*;\*2\*;\*(Pr\*s\*;\*(Pg\*s\*;\*(Pb \(-> Set background color using RGB values. If \*(xt is not compiled with direct-color support, it uses the closest match in its palette for the given RGB \*(Pr/\*(Pg/\*(Pb. .sP In each case, if \*(xt is compiled with direct-color support, and the resource directColor is true, then rather than choosing the closest match, \*(xt asks the X server to directly render a given color. . .iP
Result (\*(``OK\*('') is \*(Cs\*0\*n \*(Ps = \*6 \(-> Report Cursor Position (CPR) [row;column].
Result is \*(Cs\*(Ir\*s\*;\*(Ic\*s\*R .iP
Note: it is possible for this sequence to be sent by a function key. For example, with the default keyboard configuration the shifted F1 key may send (with shift-, control-, alt-modifiers) .iP \*(Cs\*1\*;\*2\*s\*R, or \*(Cs\*1\*;\*5\*s\*R, or \*(Cs\*1\*;\*6\*s\*R, etc. .iP The second parameter encodes the modifiers; values range from 2 to 16. See the section PC-Style Function Keys for the codes. The modifyFunctionKeys and modifyKeyboard resources can change the form of the string sent from the modified F1 key. . .iP\*(Cs\*?\*(Ir\*s\*;\*(Ic\*s\*R
(assumes the default page, i.e., \*(``1\*(''). \*(Ps = \*1\*5 \(-> Report Printer status. The response is
\*(Cs\*?\*1\*0\*n (ready). or
\*(Cs\*?\*1\*1\*n (not ready). \*(Ps = \*2\*5 \(-> Report UDK status. The response is
\*(Cs\*?\*2\*0\*n (unlocked)
or
\*(Cs\*?\*2\*1\*n (locked). \*(Ps = \*2\*6 \(-> Report Keyboard status. The response is
\*(Cs\*?\*2\*7\*;\*1\*;\*0\*;\*0\*n (North American). .iP
The last two parameters apply to VT300 & up (keyboard ready) and VT400 & up (LK01) respectively. .iP \*(Ps = \*5\*3 \(-> Report Locator status. The response is \*(Cs\*?\*5\*3\*n Locator available, if compiled-in, or \*(Cs\*?\*5\*0\*n No Locator, if not. \*(Ps = \*5\*5 \(-> Report Locator status. The response is \*(Cs\*?\*5\*3\*n Locator available, if compiled-in, or \*(Cs\*?\*5\*0\*n No Locator, if not. \*(Ps = \*5\*6 \(-> Report Locator type. The response is \*(Cs\*?\*5\*7\*;\*1\*n Mouse, if compiled-in, or \*(Cs\*?\*5\*7\*;\*0\*n Cannot identify, if not. \*(Ps = \*6\*2 \(-> Report macro space (DECMSR). The response is \*(Cs\*(Pn\*s\**\*s\*{. \*(Ps = \*6\*3 \(-> Report memory checksum (DECCKSR), VT420 and up. The response is \*(Dc\*(Pt\*s\*!\*~x\*sx\*sx\*sx\*s\*(ST.\*(Pt is the request id (from an optional parameter to the request). The x's are hexadecimal digits 0-9 and A-F. \*(Ps = \*7\*5 \(-> Report data integrity. The response is \*(Cs\*?\*7\*0\*n (ready, no errors). \*(Ps = \*8\*5 \(-> Report multi-session configuration. The response is \*(Cs\*?\*8\*3\*n (not configured for multiple-session operation). . .iP
Request ANSI mode (DECRQM). For VT300 and up, reply DECRPM is
\*(Cs\*(Ps\*;\*(Pm\*s\*$\*y
where \*(Ps is the mode number as in SM/RM, and \*(Pm is the mode value:
0 - not recognized 1 - set 2 - reset 3 - permanently set 4 - permanently reset . .iP
\*(Cs\*?\*(Ps\*;\*(Pm\*s\*$\*y
where \*(Ps is the mode number as in DECSET/DECSET, \*(Pm is the mode value as in the ANSI DECRQM.
Two private modes are read-only (i.e., \*1\*3 and \*1\*4), provided only for reporting their values using this control sequence. They correspond to the resources cursorBlink and cursorBlinkXOR. .
If the \*(xt window is non-iconified, it returns \*(Cs\*1\*t.
If the \*(xt window is iconified, it returns \*(Cs\*2\*t. \*(Ps = \*1\*3 \(-> Report \*(xt window position.
Note: X Toolkit positions can be negative, but the reported values are unsigned, in the range 0-65535. Negative values correspond to 32768-65535.
Result is \*(Cs\*3\*;\*(Ix\*s\*;\*(Iy\*s\*t \*(Ps = \*1\*3\*;\*s\*2 \(-> Report \*(xt text-area position.
Result is \*(Cs\*3\*;\*(Ix\*s\*;\*(Iy\*s\*t \*(Ps = \*1\*4 \(-> Report \*(xt text area size in pixels.
Result is \*(Cs\*s\*4\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*1\*4\*;\*s\*2 \(-> Report \*(xt window size in pixels.
Normally \*(xt's window is larger than its text area, since it includes the frame (or decoration) applied by the window manager, as well as the area used by a scroll-bar.
Result is \*(Cs\*s\*4\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*1\*5 \(-> Report size of the screen in pixels.
Result is \*(Cs\*s\*5\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*1\*6 \(-> Report \*(xt character cell size in pixels.
Result is \*(Cs\*s\*6\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*1\*8 \(-> Report the size of the text area in characters.
Result is \*(Cs\*s\*8\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*1\*9 \(-> Report the size of the screen in characters.
Result is \*(Cs\*s\*9\*;\*sheight\*s\*;\*swidth\*s\*t \*(Ps = \*2\*0 \(-> Report \*(xt window's icon label.
Result is \*(Os\*s\*L\*slabel\*s\*(ST \*(Ps = \*2\*1 \(-> Report \*(xt window's title.
Result is \*(Os\*s\*l\*slabel\*s\*(ST \*(Ps = \*2\*2\*;\*0 \(-> Save \*(xt icon and window title on stack. \*(Ps = \*2\*2\*;\*1 \(-> Save \*(xt icon title on stack. \*(Ps = \*2\*2\*;\*2 \(-> Save \*(xt window title on stack. \*(Ps = \*2\*3\*;\*0 \(-> Restore \*(xt icon and window title from stack. \*(Ps = \*2\*3\*;\*1 \(-> Restore \*(xt icon title from stack. \*(Ps = \*2\*3\*;\*2 \(-> Restore \*(xt window title from stack. \*(Ps >= \*2\*4 \(-> Resize to \*(Ps lines (DECSLPP), VT340 and VT420.
\*(xt adapts this by resizing its window. . .iP
Response is
\*(Dc\*1\*$\*u\*(Pt\*s\*(ST
Refer to the VT420 programming manual, which requires six pages to document the data string \*(Pt, \*(Ps = \*2 \(-> tab stop report (DECTABSR).
Response is
\*(Dc\*2\*$\*u\*(Pt\*s\*(ST
The data string \*(Pt is a list of the tab-stops, separated by \*(``/\*('' characters. . .iP
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 omitted, any locator motion will be reported. DECELR always cancels any previous rectangle definition. . .iP
if \*(Ps is a \*(``0\*('' (default) or \*(``1\*('', and \*(xt is emulating VT100, the control sequence elicits a response of the same form whose parameters describe the terminal: \*(Ps \(-> the given \*(Ps incremented by 2. \*(Pn = \*1 \(<- no parity. \*(Pn = \*1 \(<- eight bits. \*(Pn = \*1 \(<- \*2\*8 transmit 38.4k baud. \*(Pn = \*1 \(<- \*2\*8 receive 38.4k baud. \*(Pn = \*1 \(<- clock multiplier. \*(Pn = \*0 \(<- STP flags. . .iP
\*(Dc\*(Pi\*s\*!\*~x\*sx\*sx\*sx\*s\*(ST
\*(Pi is the request id. \*(Pg is the page number. \*(Pt\*s\*;\*(Pl\*s\*;\*(Pb\*s\*;\*(Pr denotes the rectangle. The x's are hexadecimal digits 0-9 and A-F. . .iP
Valid values for the first parameter: \*(Ps = \*0 \(-> Locator disabled (default). \*(Ps = \*1 \(-> Locator enabled. \*(Ps = \*2 \(-> Locator enabled for one report, then disabled.
The second parameter specifies the coordinate unit for locator reports.
Valid values for the second parameter: \*(Pu = \*0 or omitted \(-> default to character cells. \*(Pu = \*1 \(<- device physical pixels. \*(Pu = \*2 \(<- character cells. . .iP
Valid values for the first (and any additional parameters) are: \*(Ps = \*0 \(-> only respond to explicit host requests (DECRQLP). This is default. It also cancels any filter rectangle. \*(Ps = \*1 \(-> report button down transitions. \*(Ps = \*2 \(-> do not report button down transitions. \*(Ps = \*3 \(-> report button up transitions. \*(Ps = \*4 \(-> do not report button up transitions. . .iP
Valid values for the parameter are: \*(Ps = \*0, 1 or omitted \(-> transmit a single DECLRP locator report. .sP If Locator Reporting has been enabled by a DECELR, \*(xt 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. .sP \(<- \*(Cs\*(Pe\*s\*;\*(Pb\*s\*;\*(Pr\*s\*;\*(Pc\*s\*;\*(Pp\*s\*&\*s\*w .sP Parameters are [event;button;row;column;page].
Valid values for the event: \*(Pe = \*0 \(<- locator unavailable - no other parameters sent. \*(Pe = \*1 \(<- request - \*(xt received a DECRQLP. \*(Pe = \*2 \(<- left button down. \*(Pe = \*3 \(<- left button up. \*(Pe = \*4 \(<- middle button down. \*(Pe = \*5 \(<- middle button up. \*(Pe = \*6 \(<- right button down. \*(Pe = \*7 \(<- right button up. \*(Pe = \*8 \(<- M4 button down. \*(Pe = \*9 \(<- M4 button up. \*(Pe = \*1\*0 \(<- locator outside filter rectangle.
The \*(``button\*('' parameter is a bitmask indicating which buttons are pressed: \*(Pb = \*0 \(<- no buttons down. \*(Pb & \*1 \(<- right button down. \*(Pb & \*2 \(<- middle button down. \*(Pb & \*4 \(<- left button down. \*(Pb & \*8 \(<- M4 button down.
The \*(``row\*('' and \*(``column\*('' parameters are the coordinates of the locator position in the \*(xt window, encoded as ASCII decimal.
The \*(``page\*('' parameter is not used by \*(xt. .iP
.bP For colors and font, if \*(Pt is a \*(``?\*('', the control sequence elicits a response which consists of the control sequence which would set the corresponding value. .bP The dtterm control sequences allow you to determine the icon name and window title.
.bP Although documented in the changes for X.V10R4 (December 1986), \*(Be as a string terminator dates from X11R4 (December 1989). .bP Since XFree86-3.1.2Ee (August 1996), \*(xt has accepted \*(ST (the documented string terminator in ECMA-48).
\*(Pc\*s\*;\*(Pd .sP The first, \*(Pc, may contain zero or more characters from the set \*c, \*p, \*q, \*(cs, \*0, \*1, \*2, \*3, \*4, \*5, \*6, and \*7. It is used to construct a list of selection parameters for clipboard, primary, secondary, select, or cut-buffers 0 through 7 respectively, in the order given. If the parameter is empty, \*(xt uses \*(cs\*0, to specify the configurable primary/clipboard selection and cut-buffer 0. .sP The second parameter, \*(Pd, gives the selection data. Normally this is a string encoded in base64 (RFC-4648). The data becomes the new selection, which is then available for pasting by other applications. .sP If the second parameter is a \*?, \*(xt replies to the host with the selection data encoded using the same protocol. It uses the first selection found by asking successively for each item from the list of selection parameters. .sP If the second parameter is neither a base64 string nor \*?, then the selection is cleared. .sP \*(Ps = \*1\*0\*4\*;c \(-> Reset Color Number c. It is reset to the color specified by the corresponding X resource. Any number of c parameters may be given. These parameters 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 no parameters are given, the entire table will be reset. .sP \*(Ps = \*1\*0\*5\*;c \(-> Reset Special Color Number c. It is reset to the color specified by the corresponding X resource. Any number of c parameters may be given. These parameters correspond to the special colors which can be set using an \*(Os\*5 control (or by adding the maximum number of colors using an \*(Os\*4 control). .sP If no parameters are given, all special colors will be reset. .sP \*(Ps = \*1\*0\*6\*;c\*s\*;f \(-> Enable/disable Special Color Number c. The second parameter tells \*(xt to enable the corresponding color mode if nonzero, disable it if zero. .sP \*(Pc = \*0 \(<- resource colorBDMode (BOLD). \*(Pc = \*1 \(<- resource colorULMode (UNDERLINE). \*(Pc = \*2 \(<- resource colorBLMode (BLINK). \*(Pc = \*3 \(<- resource colorRVMode (REVERSE). \*(Pc = \*4 \(<- resource colorITMode (ITALIC). \*(Pc = \*5 \(<- resource colorAttrMode (Override ANSI). .sP If no parameters are given, this control has no effect. .sP The dynamic colors can also be reset to their default (resource) values: \*(Ps = \*1\*1\*0 \(-> Reset VT100 text foreground color. \*(Ps = \*1\*1\*1 \(-> Reset VT100 text background color. \*(Ps = \*1\*1\*2 \(-> Reset text cursor color. \*(Ps = \*1\*1\*3 \(-> Reset pointer foreground color. \*(Ps = \*1\*1\*4 \(-> Reset pointer background color. \*(Ps = \*1\*1\*5 \(-> Reset Tektronix foreground color. \*(Ps = \*1\*1\*6 \(-> Reset Tektronix background color. \*(Ps = \*1\*1\*7 \(-> Reset highlight color. \*(Ps = \*1\*1\*8 \(-> Reset Tektronix cursor color. \*(Ps = \*1\*1\*9 \(-> Reset highlight foreground color. .sP \*(Ps = \*I\*s\*;c \(-> Set icon to file. Sun shelltool, CDE dtterm.
The file is expected to be XPM format, and uses the same search logic as the iconHint resource. .sP \*(Ps = \*l\*s\*;c \(-> Set window title. Sun shelltool, CDE dtterm. .sP \*(Ps = \*L\*s\*;c \(-> Set icon label. Sun shelltool, CDE dtterm. .Ed . .Ss Privacy Message .St
Terminal keyboards have two types of keys: .bP ordinary keys, which you would use as data, e.g., in a text file, and .bP special keys, which you would use to tell \*(xt to perform some action.
\*(XT detects all of these keys via X key-press and key-release events. It uses the translations resource to decide what to do with these events. .bP Ordinary keys are handled with the insert-seven-bit or insert-eight-bit action. .bP Special keys may be handled with other resources. However, \*(xt also has built-in logic to map commonly-used special keys into characters which your keypress sends to the application running in \*(xt.
Special keyboard keys send control characters or escape sequences. This is a convention, making it convenient for applications to detect these keys, rather than a standard. .Ss "Alt and Meta Keys"
Many keyboards have keys labeled \*(``Alt\*(''. Few have keys labeled \*(``Meta\*(''. However, \*(xt's default translations use the Meta modifier. Common keyboard configurations assign the Meta modifier to an \*(``Alt\*('' key. By using xmodmap 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 metaSendsEscape resource (and altSendsEscape if altIsNotMeta is set) can be used to control the way the Meta modifier applies to ordinary keys unless the modifyOtherKeys resource is set: .bP prefix a key with the \*(Es character. .bP shift the key from codes 0-127 to 128-255 by adding 128.
When modifyOtherKeys is set, ordinary keys may be sent as escape sequences: .bP When modifyOtherKeys is set to 1, only the alt- and meta-modifiers apply. For example, alt-Tab sends \*(Cs\*2\*7\*;\*3\*;\*9\*~ (the second parameter is \*(``3\*('' for alt, and the third parameter is the ASCII value of tab, \*(``9\*(''). .bP When modifyOtherKeys is set to 2, all of the modifiers apply. For example, shift-Tab sends \*(Cs\*2\*7\*;\*2\*;\*9\*~ rather than \*(Cs\*Z (the second parameter is \*(``2\*('' for shift).
The formatOtherKeys resource tells \*n to change the format of the escape sequences sent when modifyOtherKeys applies. When modifyOtherKeys is set to 1, for example alt-Tab sends \*(Cs\*9\*;\*3\*u (changing the order of parameters). One drawback to this format is that applications may confuse it with \*(Cs\*u (restore-cursor).
The \*(xt FAQ sections
3
https://invisible-island.net/xterm/xterm.faq.html#xterm_modother
How can my program distinguish control-I from tab?
3
https://invisible-island.net/xterm/modified-keys.html
XTerm - \*(``Other\*('' Modified Keys
go into greater detail on this topic.
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 altIsNotMeta is set:
page-eject to work around grohtml bugs
.TH |
.T& |
l | l | l | l . |
key altSendsEscape metaSendsEscape result |
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 \*(Es x |
Alt+Meta-x ON off \*(Es shift |
x off ON x |
Meta-x off ON \*(Es x |
Alt-x off ON shift |
Alt+Meta-x off ON \*(Es shift |
x ON ON x |
Meta-x ON ON \*(Es x |
Alt-x ON ON \*(Es x |
Alt+Meta-x ON ON \*(Es x |
If \*(xt 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 numLock resource, or by the \*(``DECSET \*1\*0\*3\*5\*('' control sequence.
The cursor keys transmit the following escape sequences depending on the mode specified via the DECCKM escape sequence.
Key Normal Application |
.TH |
.T& |
l | l | l . |
Cursor Up \*(Cs\*A \*(S3\*A |
Cursor Down \*(Cs\*(cB \*(S3\*(cB |
Cursor Right \*(Cs\*C \*(S3\*C |
Cursor Left \*(Cs\*D \*(S3\*D |
Key Normal Application |
.TH |
.T& |
l | l | l . |
Home \*(Cs\*H \*(S3\*H |
End \*(Cs\*F \*(S3\*F |
The application keypad transmits the following escape sequences depending on the mode specified via the DECKPNM and DECKPAM 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.
Key Numeric Application Terminfo Termcap |
.TH |
.T& |
l | l | l | l | l . |
Space \*(Sp \*(S3\*(Sp - - |
Tab \*(Ta \*(S3\*I - - |
Enter \*(Cr \*(S3\*M kent @8 |
PF1 \*(S3\*P \*(S3\*P kf1 k1 |
PF2 \*(S3\*Q \*(S3\*Q kf2 k2 |
PF3 \*(S3\*R \*(S3\*R kf3 k3 |
PF4 \*(S3\*S \*(S3\*S kf4 k4 |
* \f1(multiply) \** \*(S3\*j - - |
+ \f1(add) \*+ \*(S3\*k - - |
, \f1(comma) \*, \*(S3\*l - - |
- \f1(minus) \*- \*(S3\*m - - |
. \f1(Delete) \*. \*(Cs\*3\*~ - - |
/ \f1(divide) \*/ \*(S3\*o - - |
0 \f1(Insert) \*0 \*(Cs\*2\*~ - - |
1 \f1(End) \*1 \*(S3\*F kc1 K4 |
2 \f1(DownArrow) \*2 \*(Cs\*(cB - - |
3 \f1(PageDown) \*3 \*(Cs\*6\*~ kc3 K5 |
4 \f1(LeftArrow) \*4 \*(Cs\*D - - |
5 \f1(Begin) \*5 \*(Cs\*E kb2 K2 |
6 \f1(RightArrow) \*6 \*(Cs\*C - - |
7 \f1(Home) \*7 \*(S3\*H ka1 K1 |
8 \f1(UpArrow) \*8 \*(Cs\*A - - |
9 \f1(PageUp) \*9 \*(Cs\*5\*~ ka3 K3 |
= (equal) \*= \*(S3\*(XX - - |
They also provide 12 function keys, as well as a few other special-purpose keys:
Key Escape Sequence |
.TH |
.T& |
l | l . |
F1 \*(S3\*P |
F2 \*(S3\*Q |
F3 \*(S3\*R |
F4 \*(S3\*S |
F5 \*(Cs\*1\*5\*~ |
F6 \*(Cs\*1\*7\*~ |
F7 \*(Cs\*1\*8\*~ |
F8 \*(Cs\*1\*9\*~ |
F9 \*(Cs\*2\*0\*~ |
F10 \*(Cs\*2\*1\*~ |
F11 \*(Cs\*2\*3\*~ |
F12 \*(Cs\*2\*4\*~ |
Key Escape Sequence |
.TH |
.T& |
l | l . |
F1 \*(Cs\*1\*1\*~ |
F2 \*(Cs\*1\*2\*~ |
F3 \*(Cs\*1\*3\*~ |
F4 \*(Cs\*1\*4\*~ |
Code Modifiers |
.TH |
.T& |
c | l . |
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 |
If the alwaysUseMods resource is set, the Meta modifier also is recognized, making parameters 9 through 16.
The codes used for the PC-style function keys were inspired by a feature of the VT510, referred to in its reference manual as DECFNK. In the DECFNK scheme, codes 2-8 identify modifiers for function-keys and cursor-, editing-keypad keys. Unlike \*(xt, the VT510 limits the modifiers which can be used with cursor- and editing-keypad keys. Although the name \*(``DECFNK\*('' implies that it is a mode, the VT510 manual mentions it only as a feature, which (like \*(xt) interacts with the DECUDK feature. Unlike \*(xt, VT510/VT520 provide an extension to DECUDK (DECPFK and DECPAK) which apparently was the reason for the feature in those terminals, i.e., for identifying a programmable key rather than making it simple for applications to obtain modifier information. It is not described in the related VT520 manual. Neither manual was readily available at the time the feature was added to \*(xt.
On the other hand, the VT510 and VT520 reference manuals do document a related feature. That is its emulation of the SCO console, which is similar to the \*(``xterm-sco\*('' terminal description. The SCO console function-keys are less useful to applications developers than the approach used by \*(xt because .bP the relationship between modifiers and the characters sent by function-keys is not readily apparent, and .bP the scheme is not extensible, i.e., it is an ad hoc assignment limited to two modifiers (shift and control). .Ss "VT220-Style Function Keys"
However, \*(xt is most useful as a DEC VT102 or VT220 emulator. Set the sunKeyboard resource to true to force a Sun/PC keyboard to act like a VT220 keyboard.
The VT102/VT220 application keypad transmits unique escape sequences in application mode, which are distinct from the cursor and scrolling keypad:
Key Numeric Application VT100? |
.TH |
.T& |
l | l | l | l . |
Space \*(Sp \*(S3\*(Sp no |
Tab \*(Ta \*(S3\*I no |
Enter \*(Cr \*(S3\*M yes |
PF1 \*(S3\*P \*(S3\*P yes |
PF2 \*(S3\*Q \*(S3\*Q yes |
PF3 \*(S3\*R \*(S3\*R yes |
PF4 \*(S3\*S \*(S3\*S yes |
* \f1(multiply) \** \*(S3\*j no |
+ \f1(add) \*+ \*(S3\*k no |
, \f1(comma) \*, \*(S3\*l yes |
- \f1(minus) \*- \*(S3\*m yes |
. \f1(period) \*. \*(S3\*n yes |
/ \f1(divide) \*/ \*(S3\*o no |
0 \*0 \*(S3\*p yes |
1 \*1 \*(S3\*q yes |
2 \*2 \*(S3\*r yes |
3 \*3 \*(S3\*(cs yes |
4 \*4 \*(S3\*t yes |
5 \*5 \*(S3\*u yes |
6 \*6 \*(S3\*v yes |
7 \*7 \*(S3\*w yes |
8 \*8 \*(S3\*x yes |
9 \*9 \*(S3\*y yes |
= (equal) \*= \*(S3\*(XX no |
The VT100/VT220 keypad did not have all of those keys. They were implemented in \*(xt in X11R1 (1987), defining a mapping of all X11 keys which might be provided on a keypad. For instance, a Sun4/II type-4 keyboard provided \*(``=\*('' (equal), \*(``/\*('' (divide), and \*(``*\*('' (multiply).
While the VT420 provided the same keypad, the VT520 used a PC-keyboard. Because that keyboard's keypad lacks the \*(``,\*('' (comma), it was not possible to use EDT's delete-character function with the keypad. \*(XT solves that problem for the VT220-keyboard configuration by mapping .sP Ctrl \*+ to \*, and Ctrl \*- to \*-
The VT220 provides a 6-key editing keypad, which is analogous to that on the PC keyboard. It is not affected by DECCKM or DECKPNM/DECKPAM:
Key Normal Application |
.TH |
.T& |
l | l | l . |
\f1Insert \*(Cs\*2\*~ \*(Cs\*2\*~ |
\f1Delete \*(Cs\*3\*~ \*(Cs\*3\*~ |
\f1Home \*(Cs\*1\*~ \*(Cs\*1\*~ |
\f1End \*(Cs\*4\*~ \*(Cs\*4\*~ |
\f1PageUp \*(Cs\*5\*~ \*(Cs\*5\*~ |
\f1PageDown \*(Cs\*6\*~ \*(Cs\*6\*~ |
The VT220 provides 8 additional function keys. With a Sun/PC keyboard, access these keys by Control/F1 for F13, etc.
Key Escape Sequence |
.TH |
.T& |
l | l . |
F13 \*(Cs\*2\*5\*~ |
F14 \*(Cs\*2\*6\*~ |
F15 \*(Cs\*2\*8\*~ |
F16 \*(Cs\*2\*9\*~ |
F17 \*(Cs\*3\*1\*~ |
F18 \*(Cs\*3\*2\*~ |
F19 \*(Cs\*3\*3\*~ |
F20 \*(Cs\*3\*4\*~ |
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:
Key Normal/Application |
.TH |
.T& |
l | l . |
Cursor Up \*(Es\*A |
Cursor Down \*(Es\*(cB |
Cursor Right \*(Es\*C |
Cursor Left \*(Es\*D |
Key Numeric Application VT52? |
.TH |
.T& |
l | l | l | l . |
Space \*(Sp \*(Es\*?\*(Sp no |
Tab \*(Ta \*(Es\*?\*I no |
Enter \*(Cr \*(Es\*?\*M no |
PF1 \*(Es\*P \*(Es\*P yes |
PF2 \*(Es\*Q \*(Es\*Q yes |
PF3 \*(Es\*R \*(Es\*R yes |
PF4 \*(Es\*S \*(Es\*S no |
* \f1(multiply) \** \*(Es\*?\*j no |
+ \f1(add) \*+ \*(Es\*?\*k no |
, \f1(comma) \*, \*(Es\*?\*l no |
- \f1(minus) \*- \*(Es\*?\*m no |
. \f1(period) \*. \*(Es\*?\*n yes |
/ \f1(divide) \*/ \*(Es\*?\*o no |
0 \*0 \*(Es\*?\*p yes |
1 \*1 \*(Es\*?\*q yes |
2 \*2 \*(Es\*?\*r yes |
3 \*3 \*(Es\*?\*(cs yes |
4 \*4 \*(Es\*?\*t yes |
5 \*5 \*(Es\*?\*u yes |
6 \*6 \*(Es\*?\*v yes |
7 \*7 \*(Es\*?\*w yes |
8 \*8 \*(Es\*?\*x yes |
9 \*9 \*(Es\*?\*y yes |
= (equal) \*= \*(Es\*?\*(XX no |
The \*(xt 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 sun and VT100 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. .Ss "HP-Style Function Keys"
Similarly, \*(xt can be compiled to support HP keyboards. See the xterm-hp terminfo entry for details. .Ss "Non-Function Keys"
On a DEC terminal keyboard, some of the keys which one would expect to see labeled as function keys had special names. The keys actually send character sequences as if they were the expected function keys, but the special names are used in documentation. Because other keyboards may use those names, \*(xt maps the X key symbols which have the corresponding names into the character sequences which the original DEC keyboard would send.
These mappings are used for the DEC (VT220) and other keyboards:
Label DEC SUN HP SCO |
.TH |
.T& |
l | l | l | l | l . |
Up \*(S3\*A \*(S3\*A \*(Es\*A \*(Cs\*A |
Down \*(S3\*(cB \*(S3\*(cB \*(Es\*(cB \*(Cs\*(cB |
Right \*(S3\*C \*(S3\*C \*(Es\*C \*(Cs\*C |
Left \*(S3\*D \*(S3\*D \*(Es\*D \*(Cs\*D |
Clear - - \*(Es\*J - |
Find \*(Cs\*1\*~ \*(Cs\*1\*z \*(Es\*h - |
Insert \*(Cs\*2\*~ \*(Cs\*2\*z \*(Es\*Q \*(Cs\*L |
Delete \*(Cs\*3\*~ \*(Cs\*3\*z \*(Es\*P - |
Keypad Insert \*(Cs\*2\*~ \*(Cs\*2\*z \*(Es\*Q \*(Cs\*L |
Keypad Delete \*(Cs\*3\*~ \*(Cs\*3\*z \*(Es\*P - |
Remove \*(Cs\*3\*~ \*(Cs\*3\*z \*(Es\*P - |
Select \*(Cs\*4\*~ \*(Cs\*4\*z \*(Es\*F - |
Prior \*(Cs\*5\*~ \*(Cs\*2\*1\*6\*z \*(Es\*T \*(Cs\*I |
Next \*(Cs\*6\*~ \*(Cs\*2\*2\*2\*z \*(Es\*S \*(Cs\*G |
Help \*(Cs\*2\*8\*~ \*(Cs\*1\*9\*6\*z - - |
Menu \*(Cs\*2\*9\*~ \*(Cs\*1\*9\*7\*z - - |
Home - \*(Cs\*2\*1\*4\*z \*(Es\*h \*(Cs\*H |
End - \*(Cs\*2\*2\*0\*z \*(Es\*F \*(Cs\*F |
Begin - \*(Cs\*2\*1\*8\*z - \*(Cs\*E |
\*(XT 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 saveLines 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. \*(XT 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., smcup and rmcup for terminfo, or the corresponding ti and te for termcap. The titeInhibit resource removes the ti and te strings from the TERMCAP string which is set in the environment for some platforms. That is not done when \*(xt 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 terminfo anyway, since terminfo data is not passed in environment variables; setting an environment variable in this manner would have no effect on the application's ability to switch between Normal and Alternate Screen buffers. Instead, the newer private mode controls (such as \*1\*0\*4\*9) for switching between Normal and Alternate Screen buffers simply disable the switching. They add other features such as clearing the display for the same reason: to make the details of switching independent of the application that requests the switch. . .Sh "Bracketed Paste Mode"
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: \*(Es\*([[\*2\*0\*0\*~,
followed by the pasted text, followed by \*(Es\*([[\*2\*0\*1\*~. . .Sh "Title Modes"
The window- and icon-labels can be set or queried using control sequences. As a VT220-emulator, \*(xt \*(``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 applications which still assume that titles are set using ISO-8859-1. So that is the default behavior.
If \*(xt 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 utf8Title X resource setting tells \*(xt 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, \*(xt provides the ability to query the titles, returning them either in ISO-8859-1 or UTF-8. This choice is available only while \*(xt 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, \*(xt has an optional feature which decodes the string from hexadecimal (for setting titles) or for encoding the title into hexadecimal when querying the value. . .Sh "Mouse Tracking"
The VT widget can be set to send the mouse position and other information 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: .bP mouse protocol .bP protocol encoding
The mouse protocols include DEC Locator mode, enabled by the DECELR \*(Cs\*(Ps\*s\*;\*(Ps\*s\*(qu\*s\*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 \*(Cs\*?\*(Pm\*s\*h\*('' or \*(``DECRST \*(Cs\*?\*(Pm\*s\*l\*('' control sequence.
Manifest constants for the parameter values are defined in xcharmouse.h 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 .sP #define SET_FOCUS_EVENT_MOUSE 1004 .sP #define SET_ALTERNATE_SCROLL 1007 .sP #define SET_EXT_MODE_MOUSE 1005 #define SET_SGR_EXT_MODE_MOUSE 1006 #define SET_URXVT_EXT_MODE_MOUSE 1015 #define SET_PIXEL_POSITION_MOUSE 1016
The motion reporting modes are strictly \*(xt 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 \*(xt encode numeric parameters in a single character as value+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. .Ss X10 compatibility mode
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, \*(xt sends \*(Cs\*M\*(Cb\*(Cx\*(Cy (6 characters). .bP \*(Cb is button-1, where button is 1, 2 or 3. .bP \*(Cx and \*(Cy are the x and y coordinates of the mouse when the button was pressed. .Ss Normal tracking mode
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, \*(xt sends \*(Cs\*M\*(Cb\*(Cx\*(Cy. .bP The low two bits of \*(Cb encode button information:
0=MB1 pressed,
1=MB2 pressed,
2=MB3 pressed, and
3=release.
4=Shift,
8=Meta, and
16=Control.
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 (buttons 4 and 5) are translated to scroll-back and scroll-forw actions, respectively. 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 displaying the Alternate Screen Buffer. The initial state of Alternate Scroll mode is set using the alternateScroll resource. .Ss Other buttons
Some wheel mice can send additional button events, e.g., by tilting the scroll wheel left and right.
Additional buttons are encoded like the wheel mice, .bP by adding 64 (for buttons 6 and 7), or .bP by adding 128 (for buttons 8 through 11).
Past button 11, the encoding is ambiguous because the same code may correspond to different button/modifier combinations.
It is not possible to use these buttons (6-11) in \*(xt's translations resource because their names are not in the X Toolkit's symbol table. However, applications can check for the reports, e.g., button 7 (left) and button 6 (right) with a Logitech mouse. .Ss Highlight tracking
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 button events can be received. .sP Warning: this mode requires a cooperating program, else \*(xt will hang.
On button press, the same information as for normal tracking is generated; \*(xt then waits for the program to send mouse tracking information. All X events are ignored until the proper escape sequence is received from the pty:
\*(Cs\*(Ps\*s\*;\*(Ps\*s\*;\*(Ps\*s\*;\*(Ps\*s\*;\*(Ps\*s\*T
The parameters are func, startx, starty, firstrow, and lastrow: .bP func is non-zero to initiate highlight tracking and zero to abort. .bP startx and starty give the starting x and y location for the highlighted region. .bP The ending location tracks the mouse, but will never be above row firstrow and will always be above row lastrow. (The top of the screen is row 1.)
When the button is released, \*(xt reports the ending position one of two ways: .bP if the start and end coordinates are the same locations: .sP \*(Cs\*t\*(Cx\*(Cy .bP otherwise: .sP \*(Cs\*T\*(Cx\*(Cy\*(Cx\*(Cy\*(Cx\*(Cy
The parameters are startx, starty, endx, endy, mousex, and mousey: .bP startx, starty, endx, and endy give the starting and ending character positions of the region. .bP mousex and mousey give the location of the mouse at button up, which may not be over a character. .Ss Button-event tracking
Button-event tracking is essentially the same as normal tracking, but \*(xt 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, \*(xt sends the same codes used by normal tracking mode. .bP On button-motion events, \*(xt adds 32 to the event code (the third character, \*(Cb). .bP 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 .sP \*(Cs\*M\*@\*(Cx\*(Cy .sP ( \*@ = 32 + 0 (button 1) + 32 (motion indicator) ). Similarly, motion with button 3 down is reported as .sP \*(Cs\*M\*(cB\*(Cx\*(Cy .sP ( \*(cB = 32 + 2 (button 3) + 32 (motion indicator) ). .Ss Any-event tracking
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. .Ss FocusIn/FocusOut
FocusIn/FocusOut can be combined with any of the mouse events since it uses a different protocol. When set, it causes \*(xt to send \*(Cs\*I when the terminal gains focus, and \*(Cs\*O when it loses focus. .Ss Extended coordinates
The original X10 mouse protocol limits the \*(Cx and \*(Cy ordinates to 223 (=255 - 32). \*(XT supports more than one scheme for extending this range, by changing the protocol encoding:
.bP \*(Cs\*< followed by semicolon-separated .bP encoded button value, .bP \*(Px and \*(Py ordinates and .bP a final character which is \*M for button press and \*m for button release.
.bP The modifiers are encoded in the same way. .bP A different final character is used for button release to resolve the X10 ambiguity regarding which button was released.
.bP \*(Cs followed by semicolon-separated .bP encoded button value, .bP the \*(Px and \*(Py ordinates and final character \*M.
If \*(xt is configured as VT240, VT241, VT330, VT340 or VT382 using the decTerminalID or decGraphicsID resource, it supports Sixel Graphics controls, a palleted bitmap graphics system using sets of six vertical pixels as the basic element. .St
Chapter 14 Graphics Programming The sixel data device control string has three positional parameters, following the \*q with sixel data. \*(Pa \(-> pixel aspect ratio \*(Pb \(-> background color option \*(Ph \(-> horizontal grid size (ignored). \*(Ps \(-> sixel data .Ed . .Ss "ReGIS Graphics"
If \*(xt is configured as VT125, VT240, VT241, VT330 or VT340 using the decTerminalID or decGraphicsID resource, it supports Remote Graphic Instruction Set, a graphics description language. .St
Chapter 1 Introduction to ReGIS The ReGIS data device control string has one positional parameter with four possible values: \*(Pm = 0 \(-> resume command, use fullscreen mode. \*(Pm = 1 \(-> start new command, use fullscreen mode. \*(Pm = 2 \(-> resume command, use command display mode. \*(Pm = 3 \(-> start new command, use command display mode. .Ed . .Sh "Non-VT100 Modes" .Ss "Tektronix 4014 Mode"
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.
Some of the sequences are specific to \*(xt. The Tektronix emulation was added in X10R4 (1986). The VT240, introduced two years earlier, also supported Tektronix 4010/4014. Unlike \*(xt, the VT240 documentation implies (there is an obvious error in section 6.9 \*(``Entering and Exiting 4010/4014 Mode\*('') that exiting back to ANSI mode is done by resetting private mode \*3\*8 (DECTEK) rather than \*(Es\*(Et. A real Tektronix 4014 would not respond to either. .St
Parameters for cursor movement are at the end of the \*(Es\*Y escape sequence. Each ordinate is encoded in a single character as value+32. For example, \*! is 1. The screen coordinate system is 0-based. .St
Manuals for hardware terminals are more readily available than similarly-detailed documentation for terminal emulators such as aixterm, shelltool, dtterm.
However long, the technical manuals have problems: .bP DEC's manuals did not provide a comprehensive comparison of the features in different model.
Peter Sichel's Host Interface Functions Checklist spreadsheet is useful for noting which model introduced a given feature (although there are a few apparent errors such as the DECRQSS feature cited for VT320 whereas the technical manual omits it). .bP Sometimes the manuals disagree. For example, DEC's standard document (DEC STD 070) for terminals says that DECSCL performs a soft reset (DECSTR), while the VT420 manual says it does a hard reset (RIS). .bP Sometimes the manuals are simply incorrect. For example, testing a DEC VT420 in 1996 showed that the documented code for a valid or invalid response to DECRQSS was reversed. The VT420 test results were incorporated into vttest program. At the time, DEC STD 070 was not available, but it also agrees with vttest. Later, documentation for the DEC VT525 was shown to have the same flaw. .bP Not all details are clear even in DEC STD 070 (which is more than twice the length of the VT520 programmer's reference manual, and almost three times longer than the VT420 reference manual). However, as an internal standards document, DEC STD 070 is more likely to describe the actual behavior of DEC's terminals than the more polished user's guides.
That said, here are technical manuals
which have been used in developing \*(xt.
Not all were available initially.
In August 1996 for instance, the technical references were
limited to
EK-VT220-HR-002 and
EK-VT420-UG.002.
Shortly after,
Richard Shuford sent a copy of
EK-VT3XX-TP-001.
Still later (beginning in 2003), Paul Williams' vt100.net site
provided
EK-VT102-UG-003,
EK-VT220-RM-002,
EK-VT420-RM-002,
EK-VT520-RM A01,
EK-VT100-TM-003, and
EK-VT102-UG-003.
In addition, several documents were found on the bitsavers site.
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt52/EK-VT5X-OP-001_DECscope_Users_Manual_Mar77.pdf
DECscope User's Manual.
Digital Equipment Corporation
(EK-VT5X-OP-001 1975).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf
VT100 Series Video Terminal Technical Manual.
Digital Equipment Corporation
(EK-VT100-TM-003, July 1982).
.bP
https://vt100.net/docs/vt100-ug/
VT100 User Guide.
Digital Equipment Corporation
(EK-VT100-UG-003, June 1981).
.bP
https://vt100.net/docs/vt102-ug/
VT102 User Guide.
Digital Equipment Corporation
(EK-VT102-UG-003, February 1982).
.bP
http://manx-docs.org/details.php/1,2954
VT220 Programmer Pocket Guide.
Digital Equipment Corporation
(EK-VT220-HR-002, July 1984).
.bP
https://vt100.net/docs/vt220-rm/
VT220 Programmer Reference Manual.
Digital Equipment Corporation
(EK-VT220-RM-002, August 1984).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt240/EK-VT240-RM-002_VT240_Programmer_Reference_Manual_Oct84.pdf
VT240 Programmer Reference Manual.
Digital Equipment Corporation
(EK-VT240-RM-002, October 1984).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt340/EK-VT3XX-TP-001_VT330_VT340_Text_Programming_Mar87.pdf
VT330/VT340 Programmer Reference Manual
Volume 1: Text Programming.
Digital Equipment Corporation
(EK-VT3XX-TP-001, March 1987).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt340/EK-VT3XX-GP-001_VT330_VT340_Graphics_Programming_Mar87.pdf
VT330/VT340 Programmer Reference Manual
Volume 2: Graphics Programming.
Digital Equipment Corporation
(EK-VT3XX-GP-001, March 1987).
.bP
https://vt100.net/docs/vt3xx-gp/
VT330/VT340 Programmer Reference Manual
Volume 2: Graphics Programming.
Digital Equipment Corporation
(EK-VT3XX-GP-002, May 1988).
.bP
https://vt100.net/dec/ek-vt382-rm-001.pdf
VT382 Kanji Display Terminal
Programmer Reference Manual.
Digital Equipment Corporation
(EK-VT382-RM-001).
.bP
https://vt100.net/dec/ek-vt38t-ug-001.pdf
VT382 Thai Display Terminal
Installing and Using Manual.
Digital Equipment Corporation
(EK-VT38T-UG-001, August 1989).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt420/EK-VT420-UG-001_Installing_and_Using_The_VT420_Video_Terminal_Nov89.pdf
Installing and Using
The VT420 Video Terminal
(North American Model).
Digital Equipment Corporation
(EK-VT420-UG.002, February 1990).
.bP
http://manx-docs.org/collections/mds-199909/cd3/term/vt420rm2.pdf
VT420 Programmer Reference Manual.
Digital Equipment Corporation
(EK-VT420-RM-002, February 1992).
.bP
https://vt100.net/docs/vt510-rm/
VT510 Video Terminal
Programmer Information.
Digital Equipment Corporation
(EK-VT510-RM B01, November 1993).
.bP
http://www.bitsavers.org/pdf/dec/terminal/vt5xx/EK-VT520-RM_VT520_VT525_Programmer_Information_Jul94.pdf
VT520/VT525 Video Terminal
Programmer Information.
Digital Equipment Corporation
(EK-VT520-RM A01, July 1994).
.bP
http://www.vaxhaven.com/images/f/f7/EK-PPLV2-PM-B01.pdf
Digital ANSI-Compliant Printing Protocol
Level 2 Programming Reference Manual
Digital Equipment Corporation
(EK-PPLV2-PM B01, August 1994).
.bP
http://www.bitsavers.org/pdf/ibm/pc/dos/6936752_DOS_2.00_Jan83.pdf
Disk Operating System
DOS 2.00
Microsoft, Inc.
First edition, January 1983.
.bP
https://vt100.net/manx/details/5,5479
4014 and 4014-1 Computer Display Terminal
User's Manual.
Tektronix, Inc. (070-1647-00, November 1979). .Ss "Standards"
The DEC terminal family (VT100 through VT525) is upward-compatible, using standards plus extensions, e.g., \*(``private modes\*(''. Not all commonly-used features are standard. For example, scrolling regions are not found in ECMA-48. On the other hand, ECMA-48 was not intended to all-encompassing. Quoting from the second edition: Full conformance to a standard means that all its requirements are met. For such conformance to be unique the standard must contain no options. This is typically the case for hardware standards, for instance Standard ECMA-10 for data interchange on punched tapes. This Standard ECMA-48 is of a different nature and as a result, it is only practicable to envisage limited conformance to it, as defined hereunder. This Standard addresses a whole class of devices which can vary greatly from each other depending on the application for which a device has been specifically designed. Obviously, a product which implements all facilities described in this standard \[en] thus being in \*(``full conformance\*('' with it \[en] whilst theoretically possible, would be technically and economically unthinkable.
Again, it is possible to find discrepancies in the standards: .bP The printed ECMA-48 5th edition (1991) and the first PDF produced for that edition (April 1998) state that SD (scroll down) ends with 05/14, i.e., \*^, which disagrees with DEC's VT420 hardware implementation and DEC's manuals which use 05/04 \*T. (A few other terminals such as AT&T 5620 and IBM 5151 also used 05/04, but the documentation and dates are lacking).
ECMA created a new PDF in April 2003 which changed that detail to use \*T, and later in 2008 provided PDFs of the earlier editions which used \*T. .bP The first edition of ECMA-48 has not been available, to compare. As of September 2021, ECMA's website provides a copy of ECMA-46 in its place. Earlier versions of ISO 6429 have never been available. The first three editions of ISO 6429 were issued in 1983, 1988, and 1992. .bP ANSI X3.64-1979 does not list color as a feature of the SGR sequence (page 49). In Appendix A, it mentions ECMA-48: (8) This document represents a coordinated effort to develop a single technical standard in the United States and Europe (see ECMA-48 standard entitled Additional Controls for Character Imaging Input/Output Devices). Appendix H clarifies the relationship between these documents somewhat though it confuses the first two editions of ECMA-48. The typo for \*(``work\*('' versus \*(``owkr\*('' appears in the original document: ANSI X3.64-1979, and ECMA-48, Additional Controls for Character-Imaging I/O Devices, were developed in parallel, with close liaison. ISO DP 6429, Additional Control Functions for Character-Imaging Devices, was developed as a synthesis of X3.04 and ECMA-48. During this process, some control functions as well as additional selective parameters were added. Except for point 1 below, X3.64 is a subset of ISO 6429. Although the two standards use different language, the intent is that the subset is technically identical. X3.64 was balloted and forwarded prior to the final resolution of ISO 6429 and does not incorporate the owkr of IS0/TC97/SC2 in completing ISO 6429. Revision of X3.64 will attempt to incorporate those elements and assumptions of X3.64. ANSI X3.64 goes on to say that the SGR codes 8, 30-47 are in ISO 6429. It includes 38 and 39, but omits 48 and 49. At the time, ISO 6429's first edition was still four years in the future. The writer probably was referring to the ongoing process of making ECMA-48 second edition into the ISO standard. .bP The VT320, VT420, VT520 manuals claim that DECSCL does a hard reset (RIS). Both the VT220 manual and DEC STD 070 (which documents levels 1-4 in detail) state that it is a soft reset, e.g., DECSTR. .bP The VT330/VT340 reference manual for graphics programming documents sixel scrolling in some detail in chapter 14. The VT382 Kanji and Thai manuals provide less information, but differ in their comment about the private mode DECSDM (\*(Cs\*?\*8\*0\*h), which each manual agrees should set the Sixel Scrolling feature. However, the VT330/VT340 manual saysWhen sixel display mode is set, the Sixel Scrolling feature is enabled.
Disable sixel scroll
No Sixel scrolling
Here are the relevant standards:
.bP
https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub86.pdf
Additional Controls for Use with American National Standard Code for Information Interchange, ANSI X3.64-1979
FIPS Publication 86. July 18, 1979.
American National Standards Institute, Inc.
.bP
https://www.ecma-international.org/publications/standards/Ecma-035.htm
ECMA-35: Character Code Structure and Extension Techniques
(6th Edition, December 1994).
.bP
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-043.pdf
ECMA-43: 8-bit Coded Character Set Structure and Rules
(3rd Edition, December 1991).
same as dpANS X3.134.1
.bP
https://www.ecma-international.org/publications/standards/Ecma-048.htm
ECMA-48: Control Functions for Coded Character Sets
(5th Edition, June 1991).
.bP
http://www.bitsavers.org/pdf/dec/standards/EL-SM070-00_DEC_STD_070_Video_Systems_Reference_Manual_Dec91.pdf
DEC STD 070 Video Systems Reference Manual.
Digital Equipment Corporation (A-MN-ELSM070-00-0000 Rev H, December 3, 1991). .Ss "Miscellaneous"
A few hardware terminals survived into the 1990s only as terminal emulators. Documentation for these and other terminal emulators which have influenced \*(xt are generally available only in less-accessible and less-detailed manual pages. .bP \*(XT supports control sequences for manipulating its window which were implemented by Sun's shelltool program. This was part of SunView (SunOS 3.0, 1986). The change-notes for \*(xt's resize program in X10.4 (1986) mention its use of these \*(``Sun tty emulation escape sequences\*('' for resizing the window. The X10.4 \*(xt program recognized these sequences for resizing the terminal, except for the iconify/deiconify pair. SunView also introduced the SIGWINCH signal, used by the X10.4 \*(xt and mentioned in its CHANGES file: .iP
The window size is passed to the operating system via TIOCSWINSZ (4.3) or TIOCSSIZE (sun). A SIGWINCH signal is sent if the vtXXX window is resized.
Code Sun CDE \*(XT Description |
\*(Cs\*1\*t yes yes yes de-iconify |
\*(Cs\*2\*t yes yes yes iconify |
\*(Cs\*3\*t yes yes yes move window to pixel-position |
\*(Cs\*4\*t yes yes yes resize window in pixels |
\*(Cs\*5\*t yes yes yes raise window to front of stack |
\*(Cs\*6\*t yes yes yes raise window to back of stack |
\*(Cs\*7\*t yes yes yes refresh window |
\*(Cs\*8\*t yes yes yes resize window in chars |
\*(Cs\*9\*t - - yes maximize/unmaximize window |
\*(Cs\*1\*0\*t - - yes to/from full-screen |
\*(Cs\*1\*1\*t yes yes yes report if window is iconified |
\*(Cs\*1\*2\*t - - - - |
\*(Cs\*1\*3\*t yes yes yes report window position |
\*(Cs\*1\*4\*t yes yes yes report window size in pixels |
\*(Cs\*1\*5\*t - - yes report screen size in pixels |
\*(Cs\*1\*6\*t - - yes report character cell in pixels |
\*(Cs\*1\*7\*t - - - - |
\*(Cs\*1\*8\*t yes yes yes report window size in chars |
\*(Cs\*1\*9\*t - - yes report screen size in chars |
\*(Cs\*2\*0\*t - yes yes report icon label |
\*(Cs\*2\*1\*t - yes yes report window title |
\*(Cs\*2\*2\*t - - yes save window/icon title |
\*(Cs\*2\*3\*t - - yes restore window/icon title |
\*(Cs\*2\*4\*t - - yes resize window (DECSLPP) |
\*(Os\*0\*(ST - yes yes set window and icon title |
\*(Os\*1\*(ST - yes yes set icon label |
\*(Os\*2\*(ST - yes yes set window title |
\*(Os\*3\*(ST - n/a yes set X server property |
\*(Os\*I\*(ST yes yes yes set icon to file |
\*(Os\*l\*(ST yes yes yes set window title |
\*(Os\*L\*(ST yes yes yes set icon label |
Besides the Sun-derived OSC controls for setting window title and icon label, dtterm also supported the \*(xt controls for the same feature.
The CDE source was unavailable for inspection until 2012, so that clarification of the details of the window operations relied upon vttest. .bP The SCOSC/SCORC control sequences for saving/restoring the cursor and for saving/restoring \*(``DEC Private Mode Values\*('' (XTSAVE and XTRESTORE) may appear to be related (since the \*(``save\*('' controls both end with \*(cs), but that is coincidental. The latter was introduced in X10.4 (December 1986): .iPMost Dec Private mode settings can be saved away internally using \\E[?ns, where n is the same number to set or reset the Dec Private mode. The mode can be restored using \\E[?nr. This can be used in termcap for vi, for example, to turn off saving of lines, but restore whatever the original state was on exit.
The aixterm command provides a standard terminal type for programs that do not interact directly with Enhanced X-Windows. This command provides an emulation for a VT102 terminal or a high function terminal (HFT). The VT102 mode is activated by the -v flag.