xterm(1) X Version 11 (21 August 1989) xterm(1)
NAME
xterm - terminal emulator for X
SYNOPSIS
xterm [-toolkitoption ...] [-option ...]
DESCRIPTION
The xterm client provides DEC VT102 and Tektronix 4014-
compatible terminal emulation so you can run programs that
cannot use the window system directly. If the underlying
operating system supports terminal resizing capabilities,
xterm uses these capabilities to notify programs running in
the window whenever it is resized.
The VT102 and Tektronix 4014 terminals operate separate
windows, so you can edit text in one and view graphics in
the other simultaneously. xterm restricts Tektronix
graphics to the largest box that fits in the window while
maintaining the correct aspect ratio (height:width) for a
4014. This box is located in the upper left area of the
window.
Although you can display both windows simultaneously, one of
them is considered the "active" window for receiving
keyboard input and terminal output. The active window
contains the text cursor, and its border is highlighted
whenever the pointer is in either window. You can choose
the active window through escape sequences, the Modes menu
in the VT102 window, and the Tektronix menu in the 4014
window.
OPTIONS
The term terminal emulator accepts all of the standard X
Toolkit command-line options along with the additional
options listed below. To restore an option to its default
value, type + instead of -.
-help
Prints out a message describing the options to xterm.
-132
Causes the DECCOLM escape sequence to be recognized, and
the xterm window resizes appropriately. (By default,
the VT102 DECCOLM escape sequence that switches between
80- and 132- column mode is ignored.)
-ah Highlights the text cursor and borders. By default,
xterm displays a hollow text cursor whenever the focus
is lost or the pointer leaves the window.
-bnumber.
Specifies the size of the inner border (the distance
Page 1 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
between the outer edge of the characters and the window
border) in pixels. The default is 2.
-cc characterclassrange:value[,...]
Sets character classes for selecting words. See
"Character Classes" for more information.
-cr color
Specifies the color for the text cursor. The default
uses the same foreground color used for text.
-cu Fixes a bug in the curses cursor motion package. This
bug occurs when you use more on a file containing a line
exactly the width of the window followed by another line
beginning with a tab. Without this option, the leading
tabs disappear; -cu causes them to be displayed
correctly.
-e program [arguments ...]
Specifies the program (and its command-line arguments)
to be run in the xterm window. It also sets the window
title and icon name to be the basename of the program
being executed if neither -T nor -n are given on the
command line. This must be the last option on the
command line.
-fb font
Specifies the font for displaying bold text. This font
must be the same height and width as the normal font.
If you specify only one of the normal or bold fonts, it
is used as the normal font, 6x13, and xterm produces the
bold font by overstriking this font. The default bold
font is "vtbold."
-j Indicates that xterm should do jump scrolling.
Normally, text is scrolled one line at a time; this
option allows xterm to move multiple lines at a time so
that it doesn't fall as far behind. Its use is strongly
recommended since it makes xterm much faster when
scanning through large amounts of text. The VT100
escape sequences for enabling and disabling smooth
scrolling, as well as the Modes menu, can be used to
turn this feature on or off.
-l Makes xterm send all terminal output to a log file as
well as to the screen. You can also enable or disable
this option using the xterm X11 menu.
-lf filename
Specifies the name of the file to which the output log
described above is written. If filename begins with a
pipe symbol (|), xterm assumes the rest of the string is
Page 2 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
a command used as the end point of a pipe. The default
filename is ``XtermLog.XXXXX'' (where XXXXX is the
process ID of xterm and is created in the directory from
which xterm was started or the user's home directory in
the case of a login window).
-ls Specifies that the shell started in the xterm window is
a login shell (i.e., the first character of argv[0] is a
dash, indicating to the shell that it should read the
user's .login or .profile).
+ls Indicates that the shell is a normal subshell, not a
login shell.
-mb Rings a margin bell when you type near the right margin.
You can turn this option on and off from the Modes menu.
-ms color
Specifies the color for the mouse cursor. xterm uses
the foreground color as the default. Some servers may |
not support this option.
-nb number
Specifies the number of characters from the right end of
a line at which the margin bell rings (if you have
enabled it). The default number of characters is 10.
-rw Permits reverse-wraparound, which allows the cursor to
back up from the leftmost column of one line to the
rightmost column of the previous line. This feature is
very useful for editing long shell command lines. You
can turn this option on and off from the Modes menu.
-s Permits xterm to scroll asynchronously, which means the
screen does not have to be kept completely up-to-date
while scrolling. This option allows xterm to run faster
when network traffic is very high and is typically
useful when running across a very large internet or many
gateways. The default is synchronous scrolling.
-sb Saves some number of lines (specified by the -sl option)
as they scroll off the top of the window and displays a
scroll bar so you can view those lines. You can turn
this option on and off from the Modes menu.
-sf Generates Sun function key escape codes instead of
standard escape codes.
-si Indicates that output to a window should not
automatically reposition the screen to the bottom of the
scrolling region. You can turn this option on and off
from the Modes menu.
Page 3 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
-sk Specifies that when you press a key while using the
scroll bar to review previous text lines, xterm
repositions the window automatically at the bottom of
the scroll region.
-sl number
Specifies the number of scrolled lines to save. The
default is 64.
-t Starts xterm in Tektronix mode, rather than the default,
which is VT102 mode. You can use the Modes menu to
switch between the two windows.
-tm string
Specifies a series of terminal-setting keywords followed
by the characters to be bound to those functions. This
option works like the stty program. Allowable keywords
include: intr, quit, erase, kill, eof, eol, swtch,
start, stop, brk, susp, dsusp, rprnt, flush, weras, and
lnext. You can specify control characters as ^char
(e.g., ^c or ^u) and you can use ^? to indicate delete.
-tn name
Specifies the terminal type to be set in the TERM
environment variable. This terminal type must exist in
the termcap database and should have li# and co#
entries.
-ut Indicates that xterm should not write a record into the
the system log file /etc/utmp.
-vb Specifies a visual bell. Instead of ringing the
terminal bell whenever a Ctrl-G is received, xterm
causes the window to flash.
-C Indicates that this window should receive console
output. This option is not supported on all servers.
-Sccn
Specifies the last two letters of the name of a
pseudoterminal to use in slave mode. This allows xterm
to be used as an input and output channel for an
existing program and is sometimes used in specialized
applications.
The following command-line arguments are provided for
compatibility with older versions of xterm. They may not be
supported in the next release, since the X Toolkit provides
standard options that accomplish the same task.
%geom
Specifies the preferred size and position of the
Page 4 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
Tektronix window. It is shorthand for specifying the
*tekGeometry resource.
#geom
Specifies the preferred position of the icon window. It
is shorthand for specifying the *iconGeometry resource.
-T string
Specifies the title for xterm's windows. It is
equivalent to -title.
-n string
Specifies the icon name for xterm's windows. It is
shorthand for specifying the *iconName resource. Note
that this is not the same as the toolkit option -name
(see below). The default icon name is the application
name.
-r Simulates reverse video by swapping the foreground and
background colors. It is equivalent to
-reversevideo or -rv.
-w number
Specifies the width of the window border in pixels. It
is equivalent to -borderwidth or -bw.
-L Indicates that xterm was started by init. In this mode,
xterm does not try to allocate a new pseudoterminal
because init has already done so. In addition, the
system program getty is run instead of the user's shell.
This option has been superseded by the new xdm program;
do not use this option.
The following standard X Toolkit command-line arguments are
commonly used with xterm:
-bg color
Specifies the color for the window background. The
default is "white."
-bd color
Specifies the color for the window border. The default
is "black."
-bw number
Specifies the width of the window border in pixels.
-fg color
Specifies the color for displaying text. The default is
"black."
-fn font
Page 5 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
Specifies the font for displaying normal text. The
default is "fixed."
-name name
Specifies the application name under which resources are
to be obtained, rather than the default executable file
name. Name should not contain a period (.) or an
asterisk (*).
-title string
Specifies the window title string, which the window
manager can display at your choosing. The default title
is the command line specified after the -e option, if
any; otherwise, it's the application name.
-rv Simulates reverse video by swapping the foreground and
background colors.
-geometry geometry
Specifies the preferred size and position of the VT102
window in characters; see X(1).
-display display
Specifies the X server to contact; see X(1).
-xrm resourcestring
Specifies a resource string. This is especially useful
for setting resources that do not have separate
command-line options.
-iconic
Starts xterm as an icon rather than as the normal
window.
X DEFAULTS
The program understands all of the core X Toolkit resource
names and classes as well as the following:
iconGeometry (class IconGeometry)
Specifies the preferred size and position of the
application when it is iconified. This may not work
with all window managers.
termName (class TermName)
Specifies the terminal type name to be set in the TERM
environment variable.
title (class Title)
Specifies a string the window manager can use when
displaying the xterm application.
ttyModes (class TtyModes)
Page 6 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
Specifies a string containing terminal-setting keywords
and the characters to which you can bind them. The
xterm emulator ignores this option if you specify -L,
since getty resets the terminal. Allowable keywords
include: intr, quit, erase, kill, eof, eol, swtch,
start, stop, brk, susp, dsusp, rprnt, flush, weras, and
lnext. You can specify control characters as ^char
(e.g., ^c or ^u) and you can use ^? used to indicate
delete. This is very useful for overriding the default
terminal settings without having to do an stty every
time you start an xterm session.
utmpInhibit (class UtmpInhibit)
Specifies whether or not xterm should try to record your
terminal in /etc/utmp.
sunFunctionKeys (class SunFunctionKeys)
Generates Sun function key escape codes for function
keys instead of standard escape sequences.
The following resources are specified as part of the vt100
widget (class VT100):
allowSendEvents (class AllowSendEvents)
Specifies whether or not synthetic key and button events
(generated using the X protocol SendEvent request)
should be interpreted or discarded. The default is
"false" meaning they are discarded. Note that allowing
such events creates a very large security hole.
alwaysHighlight (class AlwaysHighlight)
Specifies whether or not xterm always displays a
highlighted text cursor. By default, a hollow text
cursor is displayed whenever the pointer moves out of
the window or the window loses the input focus.
font (class Font)
Specifies the name of the normal font. The default is
"vtsingle."
boldFont (class Font)
Specifies the name of the bold font. The default is
"vtbold."
c132 (class C132)
Specifies whether or not xterm should honor the VT102
DECCOLM escape sequence. The default is "false."
charClass (class CharClass)
Specifies comma-separated lists of character class
bindings of the form [low-]high:value. You use these to
Page 7 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
determine which sets of characters should be treated the
same when doing cut and paste. See the section on
specifying character classes.
curses (class Curses)
Enables the curses bug fix. The default is "false."
background (class Background)
Specifies the color to use for the background of the
window. The default is "white."
foreground (class Foreground)
Sets the text color. Setting the class name instead of
the instance name is an easy way to have everything that
would normally appear in the "text" color change color.
The default is "black."
cursorColor (class Foreground)
Specifies the color for the text cursor. The default is
"black."
geometry (class Geometry)
Specifies the preferred size and position of the VT102
window.
tekGeometry (class Geometry)
Specifies the preferred size and position of the
Tektronix window.
internalBorder (class BorderWidth)
Specifies the number of pixels between the characters
and the window border. The default is 2.
jumpScroll (class JumpScroll)
Enables jump scrolling. The default is "false."
logFile (class Logfile)
Names the file to which a terminal session is logged.
The default is XtermLog.XXXXX (where XXXXX is the
process ID of xterm).
logging (class Logging)
Specifies whether or not a terminal session should be
logged. The default is "false."
logInhibit (class LogInhibit)
Inhibits terminal session logging. The default is
"false."
loginShell (class LoginShell)
Starts a login shell. The default is "false."
Page 8 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
marginBell (class MarginBell)
Rings a margin bell when you type near the right margin.
The default is "false."
multiScroll (class MultiScroll)
Permits asynchronous scrolling. The default is "false."
nMarginBell (class Column)
Specifies how many characters away from the right margin
you have to be for the margin bell to ring.
pointerColor (class Foreground)
Specifies the pointer color. The default is "black." |
Some servers may not support this resource. |
pointerShape (class Cursor)
Specifies the shape of the pointer. The default is
"xterm."
reverseVideo (class ReverseVideo)
Simulates reverse video. The default is "false."
reverseWrap (class ReverseWrap)
Enables reverse-wraparound. The default is "false."
saveLines (class SaveLines)
Specifies how many lines xterm should save beyond the
top of the screen when you turn on the scroll bar. The
default is 64.
scrollBar (class ScrollBar)
Displays the scroll bar. The default is "false."
scrollInput (class ScrollCond)
Specifies that output to the terminal makes the scroll
bar go to the bottom of the scrolling region. The
default is "true."
scrollKey (class ScrollCond)
Makes the scroll bar go to the bottom of the scrolling
region when you press a key. The default is "false."
signalInhibit (class SignalInhibit)
Inhibits the entries in the xterm X11 menu from sending
signals to xterm. The default is "false."
tekInhibit (class TekInhibit)
Inhibits Tektronix mode. The default is "false."
tekStartup (class TekStartup)
Starts up xterm in Tektronix mode. The default is
"false."
Page 9 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
titeInhibit (class TiteInhibit)
Removes ti or te termcap entries (used to switch between
alternate screens on start-up of many screen-oriented
programs) from the TERMCAP string.
translations (class Translations)
Specifies the key and button bindings for menus,
selections, programmed strings, etc. See KEY/BUTTON
BINDINGS below.
visualBell (class VisualBell)
Specifies a visible bell (i.e., flashing window) instead
of an audible bell when the terminal receives a Ctrl-G.
The default is "false."
The following resources are specified as part of the tek4014
widget (class Tek4014):
width (class Width)
Specifies the width of the Tektronix window in pixels.
height (class Height)
Specifies the height of the Tektronix window in pixels.
The following resources are specified as part of the menu
widget:
menuBorder (class MenuBorder)
Specifies the size of the menu border in pixels. The
default is 2.
menuFont (class Font)
Specifies the name of the font for displaying menu
items.
menuPad (class MenuPad)
Specifies the number of pixels between menu items and
the menu border. The default is 3.
The following resources are useful when specified for the
Athena Scrollbar widget:
thickness (class Thickness)
Specifies the width of the scroll bar in pixels.
background (class Background)
Specifies the color for the scroll bar background.
foreground (class Foreground)
Page 10 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
Specifies the color for the scroll bar foreground. The
"thumb" of the scroll bar is a simple checkerboard
pattern alternating pixels for foreground and background
color.
EMULATIONS
The VT102 emulation is fairly complete, but it does not
support the blinking character attribute or the double-wide
and double-size character sets. The termcap entries that
work with xterm include xterm, vt102, vt100, and ansi, and
xterm automatically searches the termcap file in this order
for these entries and then sets the TERM and the TERMCAP
environment variables.
You can modify many of the special xterm features (like
logging) under program control through a set of escape
sequences different from the standard VT102 escape
sequences.
The Tektronix 4014 emulation is also fairly good. The xterm
emulator supports four different font sizes and five
different line types. The xterm emulator records Tektronix
text and graphics commands internally, and you can write
them to a file by sending the COPY escape sequence (or
through the Tektronix menu; see below). The name of the
file will be COPYyy-MM-dd.hh:mm:ss, where yy, MM, dd, hh, mm
, and ss are the year, month, day, hour, minute, and second
when the COPY was performed. (xterm creates the file in the
directory where you started xterm, or your home directory
for a login xterm ).
XTERM KEYBOARD MAPPINGS
Function Keys
Key Normal Shift Ctrl Alt S+C A+S A+C A+S+C
F1 ^[[11~ ^[[41~ ^[[71~ ^[[131~ ^[[101~ ^[[161~ ^[[191~ ^[[221~
F2 ^[[12~ ^[[42~ ^[[72~ ^[[132~ ^[[102~ ^[[162~ ^[[192~ ^[[222~
F3 ^[[13~ ^[[43~ ^[[73~ ^[[133~ ^[[103~ ^[[163~ ^[[193~ ^[[223~
F4 ^[[14~ ^[[44~ ^[[74~ ^[[134~ ^[[104~ ^[[164~ ^[[194~ ^[[224~
F5 ^[[15~ ^[[45~ ^[[75~ ^[[135~ ^[[105~ ^[[165~ ^[[195~ ^[[225~
F6 ^[[16~ ^[[46~ ^[[76~ ^[[136~ ^[[106~ ^[[166~ ^[[196~ ^[[226~
F7 ^[[17~ ^[[47~ ^[[77~ ^[[137~ ^[[107~ ^[[167~ ^[[197~ ^[[227~
F8 ^[[18~ ^[[48~ ^[[78~ ^[[138~ ^[[108~ ^[[168~ ^[[198~ ^[[228~
F9 ^[[19~ ^[[49~ ^[[79~ ^[[139~ ^[[109~ ^[[169~ ^[[199~ ^[[229~
F10 ^[[20~ ^[[50~ ^[[80~ ^[[140~ ^[[110~ ^[[170~ ^[[200~ ^[[230~
F11 ^[[21~ ^[[51~ ^[[81~ ^[[141~ ^[[111~ ^[[171~ ^[[201~ ^[[231~
F12 ^[[22~ ^[[52~ ^[[82~ ^[[142~ ^[[112~ ^[[172~ ^[[202~ ^[[232~
F13 ^[[23~ ^[[53~ ^[[83~ ^[[143~ ^[[113~ ^[[173~ ^[[203~ ^[[233~
F14 ^[[24~ ^[[54~ ^[[84~ ^[[144~ ^[[114~ ^[[174~ ^[[204~ ^[[234~
F15 ^[[25~ ^[[55~ ^[[85~ ^[[145~ ^[[115~ ^[[175~ ^[[205~ ^[[235~
F16 ^[[26~ ^[[56~ ^[[86~ ^[[146~ ^[[116~ ^[[176~ ^[[206~ ^[[236~
F17 ^[[27~ ^[[57~ ^[[87~ ^[[147~ ^[[117~ ^[[177~ ^[[207~ ^[[237~
Page 11 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
F18 ^[[28~ ^[[58~ ^[[88~ ^[[148~ ^[[118~ ^[[178~ ^[[208~ ^[[238~
F19 ^[[29~ ^[[59~ ^[[89~ ^[[149~ ^[[119~ ^[[179~ ^[[209~ ^[[239~
F20 ^[[30~ ^[[60~ ^[[90~ ^[[150~ ^[[120~ ^[[180~ ^[[210~ ^[[240~
F15 and F16 are also known as Help and Menu on a VT220.
The keypad on the PC/AT key serves three purposes: Editing
Keypad, Numeric Keypad and Cursor Keys.
On a VT100, the cursor keys have two modes: Application and
Normal. On a VT100, the numeric keypad also has two modes:
Application and Normal.
The PC/AT keypad has five modes as follows:
Editing Cursor Applic Cursor Shift-Normal KP Shift-Applic KP
Up ^[[A ^[OA 8 ^[Ox
Down ^[[B ^[OB 2 ^[Or
Right ^[[C ^[OC 6 ^[Ov
Left ^[[D ^[OD 4 ^[Ot
Find ^[[1~
Insert ^[[2~ 0 ^[Op
Delete ^[[3~ . ^[On
Select ^[[4~
PgUp ^[[5~ 9 ^[Oy
PgDn ^[[6~ 3 ^[Os
End ^[[7~ 1 ^[Oq
Home ^[[8~ 7 ^[Ow
Num Lock has no effect on a PC keyboard. On an AT keyboard,
it will map the Editing and Cursor keypads to the shift
columns above.
The Shift key has no effect in Application Cursor Mode.
PgUp and PgDn are also known as Prior and Prev on a VT220.
Note that Delete is mapped to the kill character by default.
MOUSE USAGE
Once xterm creates the VT102 window, you can select text and
copy it within the same or other windows.
You make selections by using the mouse buttons with no
modifiers and the Shift key. The assignment of the
functions described below to keys and buttons may be changed
through the resource database; see the section on key and
button bindings below.
Mouse button one (usually left) saves text into the cut
buffer. To do this, move the mouse to beginning of the
Page 12 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
text, hold the button down while moving the mouse to the end
of the text, and release the button. When you release the
button, xterm highlights the selected text, saves it in the
global cut buffer, and makes it the primary selection.
If you double-click the mouse, you can select by words;
triple-clicking selects by lines; quadruple-clicking goes
back to characters; and each additional click cycles through
words, lines, and characters. Since the mouse determines
multiple-click by the time from button up to button down,
you can change the selection unit in the middle of a
selection.
If the key and button bindings specify that an X selection
is to be made, xterm leaves the selected text highlighted
for as long as it is the selection owner.
Mouse button two (usually middle) "pastes" (types) the text
from the PRIMARY selection, if any, or from the cut buffer
and inserts it as keyboard input.
Mouse button three (usually right) extends the current
selection. If pressed while closer to the right edge of the
selection than the left, it extends or contracts the right
edge of the selection. If you contract the selection past
the left edge of the selection, xterm assumes you really
meant the left edge, restores the original selection, then
extends or contracts the left edge of the selection.
Extension starts in the selection unit mode in which you
performed the last selection or extension; you can
multiple-click to cycle through them.
By cutting and pasting pieces of text without trailing new-
line characters, you can take text from several places in
different windows and form a command to the shell, for
example, or take output from a program and insert it into
your favorite editor. Since the cut buffer is globally
shared among different applications, you should regard it as
a "file" whose contents you know. The terminal emulator and
other text programs should treat it as if it were a text
file (that is, the text is delimited by new lines).
The scroll region displays the position and amount of text
currently showing in the window (highlighted) relative to
the amount of text actually saved. As you save more text
(up to the maximum), xterm decreases the size of the
highlighted area.
Clicking button one with the pointer in the scroll region
moves the adjacent line to the top of the display window.
Clicking button three moves the top line of the display
Page 13 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
window down to the pointer position.
Clicking button two moves the display to a position in the
saved text that corresponds to the pointer's position in the
scroll bar.
Unlike the VT102 window, the Tektronix window does not allow
you to copy text. It does allow Tektronix GIN mode; in this
mode the cursor changes from an arrow to a cross. Pressing
any key sends that key and the current coordinate of the
cross cursor. Pressing button one, two, or three returns
the letters "l," "m," and "r," respectively. If you press
the Shift key and a mouse button, the corresponding
uppercase letter is sent. To distinguish a mouse button
from a key, the high-order bit of the character is set (but
this bit is normally stripped unless the terminal mode is
RAW; see the UNIX tty (4) man page for details).
MENUS
xterm has three different menus: Xterm, Modes, and
Tektronix. Each menu pops up under the correct combinations
of key and button presses. Most menus are divided into two
sections separated by a horizontal line.
The top portion contains various modes you can alter. A
check mark appears next to modes that are currently active.
Selecting one of these modes toggles its state (that is,
from active to not active, or vice versa). The bottom
portion of the menu contains command entries; selecting one
of these performs the indicated function.
To see the Xterm menu, press the Ctrl key and left mouse
button. The modes section contains items that apply to both
the VT102 and Tektronix windows. The Secure Keyboard mode
should be used when typing in passwords or other sensitive
data; see SECURITY below. Notable entries in the command
section of the menu are: Interrupt, Hangup, Terminate, and
Kill, which send the SIGINT, SIGHUP, SIGTERM, and SIGKILL
signals, respectively, to the process group of the process
running under xterm (usually the shell). The Continue
function is especially useful if you have accidentally typed
Ctrl-Z, which suspends the process.
The Modes menu sets various modes in xterm's VT102 emulation
and pops up when the you press Ctrl and mouse button two in
the VT102 window.
The command section of this menu contains the soft reset
entry, which resets scroll regions. This function is useful
if some program has left the scroll regions set incorrectly
(this can be a problem when using VMS or TOPS-20). The full
reset entry clears the screen, resets tabs to every eight
Page 14 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
columns, and resets the terminal modes (such as wrap and
smooth scroll) to their initial states (that is, the way
they are set just after xterm has finished processing the
command-line options).
The Tektronix menu sets various modes in the Tektronix
emulation and pops up when you press the Ctrl key and mouse
button two in the Tektronix window. The current font size
is checked in the modes section of the menu. The PAGE entry
in the command section clears the Tektronix window.
SECURITY
X environments differ in their security consciousness. The
servers provided by MIT use a host-based mechanism to
control access to the server (see xhost)). If you enable
access for a host and other users are also permitted to run
clients on that host, there is the possibility that someone
will run an application that will attempt to use the basic
services of the X protocol to snoop on your activities and
potentially capture a transcript of everything you type at
the keyboard. This is of particular concern when you want
to type in a password or other sensitive data. The best
solution to this problem is for the industry to choose a
standard authorization mechanism, with the necessary
operating system support, and to incorporate this into the X
protocol (which is already designed to handle such a
mechanism). In the meantime, since passwords are most
commonly typed to something running in an xterm window, a
simple mechanism exists for protecting keyboard input in
xterm.
The xterm menu (see MENUS above) contains a Secure Keyboard
entry which, when enabled, ensures that all keyboard input
is directed only to xterm (using the GrabKeyboard protocol
request). When an application prompts you for a password
(or other sensitive data), you can enable Secure Keyboard
using the menu, type in the data, and then disable Secure
Keyboard using the menu again. Only one X client at a time
can secure the keyboard, so when you attempt to enable
Secure Keyboard it may fail. In this case, the bell sounds.
If the Secure Keyboard succeeds, the foreground and
background colors are exchanged (as if you selected the
Reverse Video entry in the Modes menu); they are exchanged
again when you exit secure mode. If the colors do not
switch, then you should be very suspicious that you are
being spoofed. If the application you are running displays
a prompt before asking for the password, it is safest to
enter secure mode before the prompt is displayed and to make
sure that the prompt is displayed correctly (in the new
colors) to minimize the probability of spoofing. You can
also bring up the menu again and make sure that a check mark
appears next to the entry.
Page 15 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
Secure Keyboard mode is disabled automatically when your
xterm window becomes iconified (or otherwise unmapped) or
when you start up a reparenting window manager (one that
places a title bar or other decoration around the window)
while in Secure Keyboard mode. (This is a feature of the X
protocol not easily overcome.) When this happens, the
foreground and background colors are switched back and the
bell sounds in warning.
CHARACTER CLASSES
The xterm emulator allows you to specify the character class
(i.e., letters, white space, punctuation, etc.) when you
select text to cut and paste.
Clicking the middle mouse button twice in rapid succession
selects all characters of the same class. Since different
people have different preferences for what should be
selected (for example, should filenames be selected as a
whole or only the separate subnames), you can override the
default mapping by using the charClass (class CharClass)
resource.
This resource is simply a list of range:value pairs where
the range is either a single number or low-high in the range
of 0 to 127, corresponding to the ASCII code for the
character or characters to be set. The value is arbitrary,
although the default table uses the character number of the
first character occurring in the set.
The default table is:
static int charClass[128] = {
/* NUL SOH STX ETX EOT ENQ ACK BEL */
32, 1, 1, 1, 1, 1, 1, 1,
/* BS HT NL VT NP CR SO SI */
1, 32, 1, 1, 1, 1, 1, 1,
/* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
1, 1, 1, 1, 1, 1, 1, 1,
/* CAN EM SUB ESC FS GS RS US */
1, 1, 1, 1, 1, 1, 1, 1,
/* SP ! " # $ % & ' */
32, 33, 34, 35, 36, 37, 38, 39,
/* ( ) * + , - . / */
40, 41, 42, 43, 44, 45, 46, 47,
/* 0 1 2 3 4 5 6 7 */
48, 48, 48, 48, 48, 48, 48, 48,
/* 8 9 : ; < = > ? */
48, 48, 58, 59, 60, 61, 62, 63,
/* @ A B C D E F G */
64, 48, 48, 48, 48, 48, 48, 48,
/* H I J K L M N O */
48, 48, 48, 48, 48, 48, 48, 48,
Page 16 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
/* P Q R S T U V W */
48, 48, 48, 48, 48, 48, 48, 48,
/* X Y Z [ \ ] ^ _ */
48, 48, 48, 91, 92, 93, 94, 48,
/* ` a b c d e f g */
96, 48, 48, 48, 48, 48, 48, 48,
/* h i j k l m n o */
48, 48, 48, 48, 48, 48, 48, 48,
/* p q r s t u v w */
48, 48, 48, 48, 48, 48, 48, 48,
/* x y z { | } ~ DEL */
48, 48, 48, 123, 124, 125, 126, 1};
For example, the string "33:48,37:48,45-47:48,38:48"
indicates that the exclamation mark (!), percent sign (%),
dash (-), period (.), slash (/), and ampersand (&) characters
should be treated the same way as characters and numbers.
This is very useful for cutting and pasting electronic
mailing addresses and UNIX filenames.
KEY TRANSLATIONS
It is possible to rebind keys (or sequences of keys) to
arbitrary strings for input by changing the translations for
the vt100 or tek4014 widgets. If you change the
translations for events other than key and button events,
xterm behaves unpredictably.
The actions available for key translations are:
insert()
Processes the key in the normal way; that is, inserts
into the input stream the ASCII character code
corresponding to the keysym found in the keyboard
mapping table.
string(string)
Rebinds the key or key sequence to the string value;
that is, inserts the string argument into the input
stream. You must enclose the string in quotation marks
if the string contains white space or non-alphanumeric
characters. If the string argument begins with the
characters "0x," it is interpreted as a hex character
constant, and the corresponding character is sent in
the normal way.
keymap(name)
Names a resource to dynamically define a new
translation table; you get the resource name by
appending the string "keymap" to name. The keymap name
None restores the original translation table (the very
first one; a stack is not maintained). It recognizes
upper- and lowercase characters.
Page 17 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
insert-selection(name[,name]...)
Retrieves the value of the first (left-most) named
existing selection or cut buffer that is not empty and
inserts the value into the input stream. name is the
name of any selection, for example, PRIMARY or
SECONDARY, or the name of a cut buffer: CUT_BUFFER0
through CUT_BUFFER7. It recognizes upper- and
lowercase characters.
For example, a debugging session might benefit from the
following bindings:
*VT100.Translations: #override <Key>F13: keymap(dbx)
*VT100.dbxKeymap.translations: \
<Key>F14: keymap(None) \n\
<Key>F17: string("next") string(0x0d) \n\
<Key>F18: string("step") string(0x0d) \n\
<Key>F19: string("continue") string(0x0d) \n\
<Key>F20: string("print ") insert-selection(PRIMARY,\
CUT_BUFFER0)
KEY AND BUTTON BINDINGS
The translation bindings within the the vt100 widget control
the key and button bindings for selecting text, pasting
text, and activating the menus. In addition to the actions
listed above under KEY TRANSLATIONS, the following actions
are available:
mode-menu()
Posts one of the two mode menus, depending on which
button is pressed.
select-start()
Unselects any previously selected text and begins
selecting new text.
select-extend()
Continues selecting text from the previous starting
position.
start-extend()
Begins extending the selection from the farthest (left
or right) edge.
select-end(name[,name]...)
Ends the text selection. name is the name of a
selection or the name of a cut buffer into which the
text gets copied. xterm asserts ownership of all the
selections named and copies the text into each of the
cut buffers. It recognizes upper- and lowercase
characters.
Page 18 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
ignore()
Quietly discards the key or button event.
bell([volume])
Rings the bell at the specified volume increment above
or below the base volume.
The default bindings are:
<KeyPress>: insert() \n\
Ctrl ~Meta <Btn1Down>: mode-menu() \n\
~Meta <Btn1Down>: select-start() \n\
~Meta <Btn1Motion>: select-extend() \n\
Ctrl ~Meta <Btn2Down>: mode-menu() \n\
~Ctrl ~Meta <Btn2Down>: ignore() \n\
~Meta <Btn2Up>: insert-selection(PRIMARY,\
CUT_BUFFER0) \n\
~Ctrl ~Meta <Btn3Down>: start-extend() \n\
~Meta <Btn3Motion>: select-extend() \n\
~Meta <BtnUp>: select-end(PRIMARY, CUT_BUFFER0) \n\
<BtnDown>: bell(0)
STARTING XTERM FROM INIT
Warning, this feature is now obsolete and is not supported
in this and future releases. Sites using this method should
switch to xdm instead.
OTHER FEATURES
The xterm program automatically highlights the window border
and text cursor when the pointer enters the selected window
and unhighlights them when the pointer leaves the window.
If the window is the focus window, it is highlighted no
matter where the pointer is.
In VT102 mode, there are escape sequences to activate and
deactivate an alternate screen buffer, which is the same
size as the display area of the window. When activated, the
current screen is saved and replaced with the alternate
screen. The feature that saves lines that scroll off the
top of the window is disabled until the normal screen is
restored. The termcap entry for xterm allows the visual
editor vi to switch to the alternate screen for editing and
restore the screen on exit.
In either VT102 or Tektronix mode, there are escape
sequences to change the name of the windows and to specify a
new log file name.
ENVIRONMENT
xterm sets the environment variables TERM and TERMCAP
properly for the size window you have created. It also uses
Page 19 (printed 12/8/89)
xterm(1) X Version 11 (21 August 1989) xterm(1)
and sets the environment variable DISPLAY to specify which
bitmap display terminal to use. The environment variable
WINDOWID is set to the X window ID number of the xterm
window.
LIMITATIONS
Variable-width fonts are not handled well.
The focus is considered lost if some other client (e.g., the
window manager) grabs the pointer; it is difficult to do
better without an addition to the protocol.
The tek4014 widget does not support key and button
rebinding.
SEE ALSO
resize(1)
X(1)
pty(4)
tty(4)
COPYRIGHT
Copyright 1988, Massachusetts Institute of Technology.
See the manual page for X(1) for a full statement of rights
and permissions.
AUTHORS
Far too many people, including:
Loretta Guarino Reid, DEC-UEG-WSL; Joel McCormack, DEC-UEG-
WSL; Terry Weissman, DEC-UEG-WSL; Edward Moy, Berkeley;
Ralph R. Swick, MIT-Athena; Mark Vandevoorde, MIT-Athena;
Bob McNamara, DEC-MAD, Jim Gettys, MIT-Athena; Bob
Scheifler, MIT X Consortium; Doug Mink, SAO, Steve Pitschke,
Stellar; Ron Newman, MIT-Athena; Jim Fulton, MIT X
Consortium; Dave Serisky, Hewlett Packard.
Page 20 (printed 12/8/89)