Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

X(1X)

dxwm(1X)

resize(1)

pty(4)

tty(4)

xterm(1X)  —  Unsupported

Name

xterm − X Window System terminal emulator

Syntax

xterm [ options ]

Description

The xterm command provides DIGITAL VT102 and Tektronix 4014 terminal emulation and a standard terminal type for programs not aware of the X Window System directly.  The terminal resizing facilities built into the system are supported by xterm. 

The DIGITAL VT102 and the Tektronix 4014 terminals each have their own windows so you can edit text in one and view graphics in the other. 

Both windows can be displayed at the same time, though only one window is active at a time.  Input is displayed in the active window even if the mouse pointer is in the other window.  You can switch between the active modes under manual (menu) and program (escape sequence) control.  To maintain the correct aspect ratio, Tektronix graphics will be restricted to the upper left area of the window. 

Options

Options specified on the xterm command line override any other corresponding specifications.  To specify that an option be returned to its default state (on or off), precede the option with a plus (+). 

−132Specifies that the DECCOLM escape sequence is to be recognized.  This sequence switches between 80-column and 132-column mode. 

−ahSpecifies the text cursor and borders should always be highlighted. 

−b pixelsSpecifies the number of pixels that are to be between text and the window border.  The default is 2. 

−bd colorSpecifies the color of the highlighted border (color displays only).  The default is black. 

−bg colorSpecifies the color of the window background (color displays only).  The default is white. 

−bw pixelsSpecifies the width of the window border in pixels.  The default is 1. 

−CSpecifies that the window should receive console output. 

−cc stringSets the character classes indicated by the specified ranges.  All ranges should be in the form ccrange:value[...]. 

−cr colorSpecifies the highlighted color of the text cursor (color displays only).  The default is the window foreground color. 

−cuSpecifies that the tabs in column one of a file be displayed.  This is useful for displaying programs that use the curses cursor motion package on a VT102-compatible terminal.  The problem, fixed with this option, occurs when the more command is run on a file containing a line that is exactly the width of the window and is followed by a line beginning with a tab.  Normally, all leading tabs disappear, but this option causes leading tabs to be displayed properly. 

−d dispnameSpecifies the display screen on which xterm displays its window.  If the display option is not specified, xterm uses the display screen specified by your DISPLAY environment variable.  The display option has the format hostname:number.  Using two colons (::) instead of one (:) indicates that DECnet is to be used for transport.  The default is :0.  For more information, see X(.).

−display dispnameThis option is the same as the −d option. 

−e command [ options ]
Specifies that the named command, and any of its specified options, be executed in the xterm window when the window is first created.  This option must appear last on the xterm command line. 

−fb fontSpecifies that the named font is to be used in place of the font that is currently used as the bold font.  This font must be the same width and length as the normal font.  This font also is used as the normal font if the normal font is not specified.  The default is vtbold. 

−fg colorSpecifies the foreground color of the window (color displays only).  The default is black. 

−fn fontSpecifies that the named font be used in the window.  Any fixed-width font can be used.  The default is vtsingle. 

−geometrySpecifies the width, length, and location of the xterm window.  If the geometry option is not specified, xterm uses default values.  The geometry option has the format =[width][xlength][x][y].  For more information about the screen coordinate system, see X(.).

−helpDisplays information about using xterm. 

−iconicSpecifies that xterm display the icon rather than the normal window at window startup. 

−jSpecifies that xterm is to use jump scrolling mode (multiple lines are moved up at once).  The VT100 escape sequences for smooth scroll can be used to enable and disable this feature from a program. 

−LSpecifies that xterm is being called by the init command and should assume both that its file descriptors are already open on a slave pseudo-tty and that a getty command should be run, rather than the user’s shell.  This option should be used only by init.  For further information, see init(.).

−lSpecifies that logging is turned on and all terminal output is appended to the log file. 

−lf fileSpecifies the file the log is written to.  By default, this file has the name XtermLog.pid.  The pid is the process ID of xterm.  The file is created in the directory that xterm was started in or, for a login xterm, in the home directory.  If the file begins with a vertical bar (|), then the rest of the string is assumed to be a command to be executed by the shell, and a pipe is opened to the process. 

−lsSpecifies that the shell that is to run under xterm be a login shell.  Then, your .login file is read and the initial directory is the home directory. 

−mbSpecifies that the right margin bell be turned on. 

−ms colorSpecifies the color of the mouse pointer (color displays only).  The default is the color of the text cursor. 

−n windowSpecifies the name of the window that is to be used by a window manager.  If no name is specified, the name xterm is used. 

−nb numSpecifies the right margin distance before the margin bell rings.  The default is 10. 

−rvSpecifies that the foreground and background colors be reversed (on color displays only).  This becomes the normal video mode and you can reverse it by turning on the reverse video mode. 

−rwSpecifies that reverse-wraparound mode be set.  This mode allows the cursor to wrap around from the leftmost column to the rightmost column of the previous line. 

−SttySpecifies the last two letters of the name of a pseudo-tty 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. 

−sSpecifies smooth (asynchronous) scroll mode.  This mode allows xterm to run faster when running across a large network or many gateways. 

−sbSpecifies that the scroll bar be displayed at xterm startup, with the saving of lines scrolled off the top of the window turned on. 

−siSpecifies that the scroll bar not be repositioned to the bottom of text when input has arrived. 

−skSpecifies that the scroll bar be repositioned to the bottom of text when any key is pressed. 

−sl numSpecifies the maximum number of lines to save that are scrolled off the top of the window.  The default is 64 lines. 

−tSpecifies xterm startup in Tektronix mode, rather than VT102 mode.  The default is VT102. 

−vbSpecifies that the visual bell mode be set.  In this mode, xterm flashes the window when it receives a CTRL/G. 

−xrm stringSpecifies the resource string to be used.  This is useful for setting resources that do not have separate command line options. 

Menus

The xterm window provides the following menus:

xtermDisplays commands that allow you to manipulate processes running in the xterm window. 

ModesDisplays commands that allow you to specify various modes in the VT102 emulation. 

Each menu has two areas.  The first area lists modes that can be altered.  All modes preceded by a check mark are on.  The second area lists command entries that, when selected, perform the indicated function.  When the name of a mode or command is dimmed within a menu, that mode or command is not available for selection. 

Xterm Menu

You display the xterm menu by positioning the mouse pointer at any location within the window and then pressing and holding both the CTRL key and mouse button 1. 

The modes and commands listed in the xterm menu are:

Visual BellSpecifies that the visual bell be displayed.  The default is off. 

Deiconify WarpSpecifies that the mouse pointer is positioned at the center of the window at deiconification.  The default is off. 

LoggingSpecifies that all input from the pseudo-tty is appended to the log file.  The default is off. 

RedrawRepaints the window. 

ContinueSends a continue signal to xterm and the processes running under it. 

SuspendSends a suspend signal to xterm and the processes running under it. 

InterruptSends an interrupt signal to xterm and the processes running under it. 

HangupSends a hangup signal to xterm and the processes running under it. 

TerminateSends a terminate signal to xterm and the processes running under it. 

KillSends a kill signal to xterm and the processes running under it. 

Modes Menu

You can display the modes menu by positioning the mouse pointer at any location within the window and pressing and holding both the CTRL key and mouse button two. 

The modes and commands listed in the Modes menu are:

Jump ScrollSpecifies that new lines appear on the screen as fast as the computer sends them to the terminal.  The default is smooth-scroll mode.  In smooth-scroll mode, a limit is placed on the speed at which new lines of data can be sent to the terminal. 

Reverse VideoSpecifies that the foreground and background color be reversed.  The default is off. 

Auto WraparoundSpecifies that, depending on the line size selected, the character after the last character displayed on the line be placed in the first character position of the next line.  The default is off. 

Reverse WraparoundSpecifies that the cursor is to wrap around from the leftmost column to the rightmost column of the previous line.  The default is off. 

Auto LinefeedSpecifies that an automatic line feed be inserted at a carriage return.  The default is off. 

Application CursorsSpecifies that the behavior of the arrow keys is to change: instead of putting out <ESC>[A through <ESC>[D, they put out <ESC>OA through <ESC>OD.  The default is off. 

Application PadSpecifies that the behavior of the number keys on the numeric pad is to be controlled by individual applications.  The default is off. 

Auto RepeatSpecifies that a key be automatically repeated when the key is held down.  The default is on. 

ScrollbarSpecifies that the scroll bar be displayed.  The default is off. 

Scroll to bottom on keySpecifies that xterm reposition the scroll region at the end of the text when any key is pressed.  The default is off. 

Scroll to bottom on inputSpecifies that xterm automatically reposition the scroll region at the bottom of new, incoming text.  The default is on. 

80 <-> 132 ColumnsSpecifies either 80-column or 132-column mode.  The default is off. 

Curses EmulationSpecifies that xterm use the curses cursor emulation package.  The default is off. 

Margin BellSpecifies that the right margin bell is set.  The default is off. 

Tek Window ShowingSpecifies that the Tektronix window appear. 

Alternate ScreenSpecifies that xterm place the current screen in the alternate screen buffer and display the previously saved screen.  To redisplay your normal screen, select this command again. 

Soft resetResets scroll regions. 

Full resetClears the screen, resets tabs to every eight columns, and resets the terminal modes to their initial states. 

Select Tek ModeAllows the Tektronix window to accept input. 

Hide VT WindowHides the VT window while xterm is in Tektronix mode. 

Creating Windows

When you use the mouse to create the Tektronix window, a cursor and a rubber-banding box will outline where the window will be created on the display.  If you press MB1, a default size window (750 pixels wide by 565 pixel high) is created at the origin.  If you press MB2, a default size window is created at the mouse pointer position.  If you press MB2 and hold it down, the upper left-hand corner of the window is defined at this position.  An outline of the minimum size window is shown, and a popup window in the upper left hand corner of the display will appear, indicating Tektronix mode.  Moving the mouse (while still holding the button down) will enlarge the window.  Releasing the button will define the lower right hand corner of the window. 

In VT102 mode, you can use escape sequences to activate and deactivate an alternate screen buffer, which is the same size as the display area of the window.  When you activate the buffer, the current screen is saved and replaced with the alternate screen.  Saving of lines scrolled off the top of the window and page scroll mode are disabled until the normal screen is restored.  The termcap(5) entry for xterm allows the visual editor vi(1) to switch to the alternate screen for editing, and restore the screen on exit. 

The default icon is a small box containing the window name.  If you want to use pictures, you can use the files ~/vt_icon.ic and ~/tek_icon.ic.  See the −ib and −it options and the IconBitmap resource in the X DEFAULTS section. 

Character Classes

Clicking MB2 twice in rapid succession will cause all characters of the same class (for example letters, white space, punctuation) to be selected.  You can override the default character class mapping through the use of the clarClass (class CharClass) resource. 

This resource is 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,
/*   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,64: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 useful for cutting and pasting electronic mailing addresses and 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 widget.  Changing the translations for events other than key presses is not expected, and will cause unpredictable behavior. 

The actions available for key translations are “insert”, “string”, “keymap”, and “selection”.  The insert action causes the key to be processed in the normal way.  The string action takes a single string argument, and rebinds the key/sequence to that string value.  The keymap action takes a single string argument naming a resource to be used to dynamically define a new translation table; the name of the resource is obtained by appending the string “Keymap” to the string argument to the action.  A string argument of “None” to the keymap action restores the original translation table (the very first one; a stack is not maintained).  The selection action takes a single string argument specifying a selection and causes the contents of that selection to be used as effective input. 

Cut And Paste

Once the VT102 window is created, xterm allows you to select text and copy it within the same window or to other windows. 

The selection functions are invoked when the pointer buttons are used with no modifiers, and when they are used with the “shift” key. 

MB1 is used to save text into the cut buffer.  Move the cursor to beginning of the text, and then hold the button down while moving the cursor to the end of the region and release the button.  The selected text is highlighted and is saved in the global cut buffer when the button is released.  Double-clicking selects by words.  Triple-clicking selects by lines.  Multiple-click is determined by the time from button up to button down, so you can change the selection unit in the middle of a selection. 

MB2 inserts (pastes) the text from the cut buffer, as keyboard input. 

MB3 extends the current selection.  If pressed while closer to the right edge of the selection than the left, it extends/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/contracts the left edge of the selection.  Extension starts in the selection unit mode that the last selection or extension was performed in; you can multiple-click to cycle through them. 

By cutting and pasting pieces of text without trailing new lines, 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 be treating it as if it were a text file.  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 more text is saved (up to the maximum), the size of the highlighted area decreases. 

Clicking MB1 in the scroll region moves the adjacent line to the top of the display window. 

Clicking MB3 moves the top line of the display window down to the pointer position. 

Clicking MB2 moves the display to a position in the saved text that corresponds to the pointer’s position in the scrollbar. 

Unlike the VT102 window, the Tektronix window does not allow the copying of text.  It does allow Tektronix GIN mode, and in this mode the cursor changes from an arrow to a cross.  Pressing any key will send that key and the current coordinate of the cross cursor.  Pressing the MB1, MB2, or MB3 will return the letter l, m, or r, respectively.  If you press the SHIFT key with a mouse button, the corresponding upper case letter is sent.  To distinguish a mouse button from a key, the high bit of the character is set (but this bit is normally striped unless the terminal mode is RAW; see tty(4) for more information). 

Restrictions

The VT102 emulation does not support the blinking character attribute or the double-wide, double-height character sets. 

If you attempt to copy (paste) more than 255 characters in an xterm window, you receive an error message similar to the following:

X: could not write data for 10 seconds

This message indicates that xterm has had a fatal error.  To avoid this error, reduce the amount of data that you are trying to paste to the xterm window. 

X Defaults

The xterm application reads the .Xdefaults file during startup and uses the appropriate resource specification to customize the appearance or characteristics of its displayed xterm window.  The format for a resource specification in the .Xdefaults file is: [name.]resource:  value

nameSpecifies the application name or, in the case of X Toolkit-based applications, the name string that restricts the resource assignment to that application or to a component of an application.  If this argument is not specified, the resource assignment is globally available to all X applications. 

resourceSpecifies the X resource. 

valueSpecifies the value that is to be assigned to the resource. 

In most cases, the period (.) delimiter should be replaced by an asterisk (*).  For more information, see X(.).

For xterm, the available name is xterm. 

For xterm, the available resources are:

alwaysHighlightSpecifies xterm should display a highlighted text cursor when the pointer moves out of the window or the window loses the input focus.  The default is a hollow text cursor. 

backgroundSpecifies the background color.  The default is white. 

boldFontSpecifies a default fixed-width bold font.  The default is vtbold. 

c132Specifies whether the DECCOLM escape sequence is to switch between 80-column and 132-column mode.  The default is 80. 

cursesSpecifies whether the fix to the curses cursor emulation package is to be enabled.  The default is off. 

cursorColorSpecifies the text cursor color.  The default is black. 

fontSpecifies the fixed-width font displayed in the xterm window.  The default is vtsingle. 

foregroundSpecifies the text color.  The default is black. 

geometrySpecifies the geometry (window size and screen location) of the xterm window.  For more information about the format of the geometry option, see OPTIONS. 

internalBorderSpecifies the space (number of pixels) between the text and window border.  The default is 2. 

jumpScrollSpecifies whether jump scroll is to be enabled.  The default is off. 

logFileSpecifies the log file or command to pipe to when logging is activated.  The default is XtermLog.pid. 

loggingSpecifies whether logging is to be turned on at xterm startup.  The default is off. 

logInhibitSpecifies whether logging can or cannot be turned on.  The default is off. 

loginShellSpecifies whether the shell executed in the xterm window at startup is to be a login shell.  The default is off. 

marginBellSpecifies whether the margin bell is to be enabled.  The default is off. 

multiScrollSpecifies smooth (asynchronous) scroll mode. 

nMarginBellSpecifies the margin bell right margin distance (number of characters). 

pointerColorSpecifies the color of the pointer.  The default is black. 

pointerShapeSpecifies the name of the shape of the pointer.  The default is xterm. 

reverseVideoSpecifies whether the foreground and background colors are to be reversed (on monochrome displays only).  The default is off. 

reverseWrapSpecifies whether reverse wraparound mode is to be enabled.  The default is off. 

saveLinesSpecifies the number of lines saved when scrolled off the top of the window.  The default is 64.  Lines are saved only when scrollbar is on. 

scrollBarSpecifies whether the scroll bar is to be displayed at xterm window startup.  The default is off. 

scrollInputSpecifies whether xterm is automatically to reposition the scroll region at the bottom of new, incoming text.  The default is on. 

scrollKeySpecifies whether xterm is to reposition the scroll region at the end of the window’s text when any key is pressed.  The default is off. 

signalInhibitSpecifies whether the sending of signals from the xterm menu is to be totally inhibited.  The default is off. 

tekGeometrySpecifies the size and position of the Tektronix window. 

tekIconBitmapSpecifies the bitmap file to be used as the bitmap for a Tektronix-mode icon. 

tekInhibitSpecifies whether Tektronix mode is to be disabled. 

tekStartupSpecifies that a Tektronix window is displayed rather than a VT102 window. 

titleInhibitSpecifies xterm should remove ti or te termcap entries from the TERMCAP string.  These entries are used to switch between alternate startup screens for many screen-oriented programs. 

visualBellSpecifies whether the visual bell mode is set at xterm window startup.  The default is off. 

windowNameSpecifies the name of the window that is to be used by a window manager.  If no name is specified, the name xterm is used.  Termcap (5) 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 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 4015 supports four different font sizes and five different line types.  The Tektronix text and graphics commands are recorded internally by xterm 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 (the file is created in the directory xterm is started in, or the home directory for a login xterm ). 

Environment

When executed, xterm sets the environment variables TERM and TERMCAP properly for the size of the window you have created.  The environment variable WINDOWID is set to the X window ID number of the xterm window. 

See Also

X(1X), dxwm(1X), resize(1), pty(4), tty(4)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026