XTERM(1)

NAME
xterm - X window system terminal emulator

SYNOPSIS
xterm [ option ] ...

DESCRIPTION
Xterm is the X window system terminal emulator. It attempts to emulate a DEC VT102 terminal to provide a standard terminal type for programs not aware of the window system directly. Under 4.3BSD, Ultrix 1.2 and other systems with the capability, xterm supports the terminal resizing facilities built into the system.

In addition, xterm emulates the Tektronix 4015 in a separate window. To maintain the correct aspect ratio (height/width), Tektronix graphics will be restricted to the largest box with a 4015's aspect ratio that will fit in the window. This box is located in the upper left area of the window.

Both windows may be displayed at the same time, though only one window and mode is active at a time. Input will be displayed in the active window even if the mouse is in the other window. Switching between the active modes is possible under manual (menu) and program (escape sequence) control.

Xterm understands the following options. If the option begins with a `+' instead of a `-', the option is restored to its default value. These options override those set in the ``.Xdefaults'' file (see the X DEFAULTS section).

-132
    Normally, the VT102 DECCOLM escape sequence that switches between 80 and 132 column mode is ignored. This option causes the DECCOLM escape sequence to be recognized, and the xterm window will resize appropriately.

-C  When xterm is run on a Sun, this option causes messages normally destined for the console device, to be displayed in the xterm window.

-L  indicates that xterm is being called by init(8), and should presume that its file descriptors are already open on a slave pseudo-tty, and that getty(8) should be run rather than the user's shell. This option should only be used by init(8)

-ar This option turns on the auto-raise mode of xterm, which automatically raises the window when the mouse cursor enters the window.

-b border
    Xterm maintains an inner border (distance between characters and the window's border) of one pixel. The -b option allows you to set the size of this border to border.

-bd color
    On color displays, determines the color of the (highlighted) border.

-bg color
    On color displays, determines the color of the background.

-bi This option forces the icon to be a static bitmap rather than the default miniature window.

-bw borderwidth
    Allows you to specify the width of the window border in pixels.

-cr color
    On color displays, determines the (highlighted) color of the text cursor; default is the text (foreground) color.

-cu Several programs that use the curses(3x) cursor motion package have some difficulties with VT102-compatible terminals. The bug fixed with this option occurs with more(1) on a file containing a line that is exactly the width of the window and which is followed by line beginning with a tab. Normally, the leading tabs disappear, but this option causes them to be displayed correctly.

-dw When the xterm icon is deiconified, this option warps the mouse to the center of the window.

-e command arguments
    The specified command will be executed in the window, rather than starting a shell. The command and the optional arguments must appear last on the xterm command line.

-fb font
    The specified font will be used instead of the default bold font (which is ``vtbold''). This font must be the same height and width as the normal font. If only one of the normal or bold fonts is specified, it will be used as the normal font and the bold font will be produced by overstriking this font.

-fg color
    On color displays, determines the color of the text (foreground).

-fi font
    Specifies the default font to be used for the miniature icon windows. The usual value for the icon font is ``nil2''.

-fn font
    The specified font will be used instead of the default font (which is ``vtsingle''). Any fixed width font may be used.

-ft font
    The specified font will be used in the title bar instead of the default font (which is ``vtsingle'').

-i  This option causes xterm to startup displaying the icon rather than the normal window.

-ib file
    The file, which is assumed to be in bitmap(1) format, is read and the resulting bitmap is used in the icon when in VT102 mode. If only one bitmap file is specified, it is used for both modes. If both the bitmap file names are null, no bitmap is used.

-it file
    The file, which is assumed to be in bitmap(1) format, is read and the resulting bitmap is used in the icon when in Tektronix mode. If only one bitmap file is specified, it is used for both modes. If both the bitmap file names are null, no bitmap is used.

-j  Xterm will `jump scroll'; when xterm falls behind scrolling the screen, it will move multiple lines up at once. The VT100 escape sequences for smooth scroll can be used to enable/disable this feature from a program, or the `Mode Menu' can be used to set it interactively.

-l  Logging is turned on; all input from the pseudo tty is appended to the logfile.

-lf file
    This file specifies the file in which the log is written to, rather than the default ``XtermLog.XXXXX'' where XXXXX is the process id of xterm (the file is created in the directory xterm is started in, or the home directory for a login xterm). If file begins with a ``|'' 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.

-ls This option causes the shell run under xterm to be a login shell (the user's .login file is read and the initial directory will be the home directory).

-mb This option turns on the right margin bell.

-ms color
    On color displays, determines the color of the mouse cursor; default is the text cursor color.

-n windowname
    Allows you to set the name of the window for use by a window manager. This name is displayed in the title bar, also.

-nb number
    This number is used as the right margin distance in which the margin bell will ring (the default is 10).

-po number
    Normally, in page scroll mode, a ``page'' is defined to be the number of lines in the scrolling region minus the page overlap, which is one by default. Number specifies a new page overlap.

-ps Page scroll mode is initially turned on. After a ``page'' of lines is displayed, xterm will stop displaying any more lines and the text cursor will disappear. Typing a carriage return will allow one more line to be scrolled (the return is discarded). Pressing the space bar (or any other printable character) allows another page to be scrolled (the character is discarded). Typing a control character allows another page to be scrolled, but the control character is sent (e.g., the interrupt character).

-r  The screen will be displayed with white characters on a black background, rather than the default black on white. This becomes the normal video mode, which is reversed by turning on the reverse video mode.

-rv Same as -r.

-rw This options turns on reverse-wraparound mode, that allows the cursor to wraparound from the leftmost column to the rightmost column of the previous line. This is very useful in the shell to allow erasure backwards across the previous line.

-s  When this option is specified, xterm no longer scrolls synchronously with the display. Xterm no longer attempts to keep the screen completely up to date while scrolling, but can then run faster when network latencies are very high. This is typically useful when using xterm across a very large internet or many hops.

-sb This option causes the scrollbar to be displayed during startup, with the saving of lines scrolled off the top of the window being turned on.

-si When using the scrollbar to review previous lines of text, the window is normally repositioned automatically at the bottom of the scroll region when input has arrived. This option disables repositioning on input.

-sk When using the scrollbar to review pass lines of text, this option causes the window to be repositioned automatically in the normal postion at the bottom of the scroll region when a key is pressed.

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

-sn By default, the status line is in revere-video (relative to the rest of the window). This option causes the status line to be in normal video (the status line is still enclosed in a box).

-st This option causes the status line to be displayed on startup.

-t  This option causes the initial xterm window to be the Tektronix window, rather than the normal VT102 window.

-tb This option disables the title bar from being displayed on startup.

-ti Normally in the icon, the window name is to the right of the bitmap. This option causes the text to be under the icon.

-vb This option turns on the visual bell mode, which flashes the window on receipt of a CTRL-G.

-w  Same as -bw.

=geometry
    Xterm will take a normal X geometry specification for the VT102 window. This takes the form of ``=widthxheight+xoff+yoff''. See X(1) for details of this specification.

%geometry
    This geometry specification applies to the Tektronix window.

#geometry
    This geometry specification applies to the icon position (the width and height information are optional and otherwise ignored).

host:display
    Normally, xterm gets the host and display number to use from the environment variable ``DISPLAY''. One can, however specify them explicitly. The host specifies which machine to create the window on, and the display argument specifies the display number. For example, ``orpheus:1'' creates a shell window on display one on the machine orpheus.

X DEFAULTS
Xterm allows you to preset defaults in a customization file in your home directory, called .Xdefaults. The format of the file is ``programname.keyword:string''. See X(1) for more details. Xterm obeys the convention for `MakeWindow' defaults. Keywords recognized by xterm are listed below.

ActiveIcon
    If ``off'', xterm window icons(s) are static bitmaps rather than miniature windows.

AllowIconInput
    If ``on'', then keyboard input is permitted when xterm windows are in their iconified state and the icon is a miniature window. Keyboard input is always disabled when static bitmap icons are used.

AutoRaise
    If ``on'', xterm window(s) are automatically raised when the mouse enters them.

Background
    Set the background color.

BodyFont
    Set the default font.

BoldFont
    Specify a default bold font.

Border
    Set the border color.

BorderWidth
    Set the border width of the window.

C132
    If ``on'', allow the DECCOLM escape sequence to switch between 80 and 132 column mode.

Curses
    If ``on'', enable the curses(3x) fix.

Cursor
    Set the text cursor color.

DeiconifyWarp
    If ``on'', warp the mouse to the center of the window after deiconification.

Foreground
    Set the text color.

IconBitmap
    Specifies the bitmap(1) file to be used as the bitmap for VT102 mode icon.

IconFont
    Specify the default font for miniature window icons. The usual value is ``nil2''.

IconStartup
    If ``on'', initially display the icon rather than the normal window.

InternalBorder
    Set the space between the text and window border. This is called padding above.

JumpScroll
    If ``on'', jump scroll is enabled.

LogFile
    Specifies the log file or command to pipe to when logging is activated.

Logging
    If ``on'', turn logging on initially.

LogInhibit
    If ``on'', totally inhibit logging from being turned on.

LoginShell
    If ``on'', make the shell executed a login shell.

MarginBell
    If ``on'', turn on the margin bell.

MenuBorder
    specifies the border width for the menus. The default is 2.

MenuPad
    specifies the extra padding above and below the menu title. The default is 3.

MenuFont
    specifies the font to be used within the menus. The default is the same font used for the titlebar.

Mouse
    Set the mouse cursor color.

NMarginBell
    Set the margin bell right margin distance.

PageOverlap
    Set the page overlap in page scroll mode.

PageScroll
    If ``on'', turn on page scroll mode.

ReverseVideo
    If ``on'', reverse the definition of foreground and background color.

ReverseWrap
    If ``on'', turn on the reverse wraparound mode.

SaveLines
    Set the number of lines to save when scrolled of the top of the window.

ScrollBar
    If ``on'', show the scrollbar initially.

ScrollInput
    If ``off'', disable repositioning the scroll region at the bottom if new input has arrived.

ScrollKey
    If ``on'', reposition the scroll region at the bottom if a key is pressed.

SignalInhibit
    If ``on'', totally inhibit the sending of signals from the xterm menu.

StatusLine
    If ``on'', show the status line on startup.

StatusNormal
    If ``on'', make the status line normal video.

TekIconBitmap
    Specifies the bitmap(1) file to be used as the bitmap for Tektronix mode icon.

TekInhibit
    If ``on'', totally inhibit going into Tektronix mode.

TextUnderIcon
    If ``on'', place the icon text under the bitmap icon.

TitleBar
    If ``off'', don't show the title bar on startup.

TitleFont
    Set the font of the title bar text.

VisualBell
    If ``on'', turn on visual bell mode at startup.

EMULATIONS
The VT102 emulation is fairly complete, but does not support the blinking character attribute nor the double-wide and double-size character sets. Termcap(5) entries that work with xterm include ``xterms'', ``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.

Many of the special xterm features (like the scrollbar and logging) may be modified under program control through a set of escape sequences different from the standard VT102 escape sequences. Also, many of the Sun tty escape sequences for resizing and moving the window are also understood. (See the ``Xterm Control Sequences'' document.)

The Tektronix 4015 emulation is also fairly good. Four different font sizes and five different lines types are supported. The Tektronix text and graphics commands are recorded internally by xterm and may be written 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).

MOUSE USAGE

When using the mouse to create the VT102 window, a cursor and a rubber banding box will outline where the window will be created on the display. If the left button is pressed, a HEIGHTxWIDTH (default 24x80) size window will be created at the position where the button is released. If the right button is pressed, a window the height of the display and WIDTH (default 80) characters wide will be created. If the center button is pressed and held 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 show the size in characters of the window. Moving the mouse (while still holding the button down) will enlarge the window and the sizes in the pop up window will update accordingly. Releasing the button will define the lower right hand corner of the window.

Once the VT102 window is created, xterm allows you to save text and restore it within the same or other windows. The button functions are enabled when holding down the ``shift'' key. The left hand button takes the text from the cursor (at button release) through the end of line (including the new line), saves it in the global cut buffer, and immediately `retypes' the line, inserting it as keyboard input. This provides a history mechanism. The selected text is highlighted while the button is pressed. Moving off the initial line will cancel the selection. If there is no text beyond the initial cursor point, xterm will sound the bell, indicating an error.

The shifted center button 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 releasing the button. The selected text is highlighted and is saved in the global cut buffer when the button is released.

The shifted right hand button `types' (pastes) the text from the cut buffer, inserting it as keyboard input. 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, i.e. the text is delimited by new lines.

The scrollbar is composed of three parts, the scroll button at the top, the recorder button in the middle and the scroll region at the bottom. Pressing the middle button in any part of the scrollbar will display the scrollbar menu; see the MENUS section below.

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 the mouse with the left of right button in the scroll region will position the top of the display window at the mouse position.

The recorder button shows the state of saving lines scrolled off the top of the window. Tape running reel to reel indicates on, while the tape hanging indicates off. Clicking the left or right button in the recorder button toggles the state of recording.

The scroll button causes the window to scroll up and down within the saved text. The left button moves the window position up (the text scrolls downward), while the right button moves the window position down (the text scrolls upward). The amount of scrolling is modified by the ``shift'' and ``control'' keys. Without either, the window scrolls a single line at a time. Continuing to hold the button down will causes the text to continuously scroll a line at a time.

The ``shift'' key causes the text to scroll a window full at a time (actually it is one line less than a full window). And the ``control'' key causes the text to be positioned at the extremes, top or bottom.

When using 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 the left button is pressed, a default size window (750 pixels wide by 565 pixel high) is created at the origin. If the right button is pressed, a default size window is created at the mouse position. If the center button is pressed and held 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.

Unlike the VT102 window, the Tektronix window dows not allow the copying of text. It does allow Tektronix GIN mode, and in this mode the cursor will change from an arrow to a cross. Pressing any key will send that key and the current coordinate of the cross cursor. Pressing the left, middle or right button will return the letters `l', `m', and `r', respectively. If the `shift' key is pressed when a mouse buton is pressed, the corresponding upper case letter is sent. To distinquish a mouse button from a key, the high bit of the character is set (but this is bit is normally stripped unless the terminal mode is RAW; see tty(4) for details).

MENUS
Xterm has five different menus, named xterm, Modes, Tektronix, Scrollbar and Windows. Each menu pops up under the correct combinations of key and button presses. Most menus are divided into two section, separated by a horizontal line. The top portion contains various modes that can be altered. A check mark appears next to a mode that is currently active. Selecting one of these modes toggles its state. The bottom portion of the menu are command entries; selecting one of these performs the indicated function.

The xterm menu pops up when the ``control'' key and the left button is pressed in a window. The menu title gives the version number of xterm. The modes section contains items that apply to both the VT102 and Tektronix windows. Notable entries in the command section of the menu are the Continue, Suspend, Interrupt, Hangup, Terminate and Kill which sends the SIGCONT, SIGTSTP, 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 the user has accidentally typed CTRL-Z, suspending the process.

The Modes menu sets various modes in the VT102 emulation, and is popped up with the ``control'' and middle button combination in the VT102 window. In the command section of this menu, the soft reset entry will reset scroll regions. This can be convenient when some program has left the scroll regions set incorrectly (often a problem when using VMS or TOPS-20). The full reset entry will clear the screen, reset tabs to every eight columns, and reset the terminal modes (such as wrap and smooth scroll) to there initial states just after xterm has finish processing the command line options. The Tektronix menu sets various modes in the Tektronix emulation, and is popped up with the ``control'' and middle button combination 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.

The Scrollbar menu is popped up when the middle button is pressed within the scrollbar. This menu allows several modes particular to the scrollbar to be set.

The Windows menu is not normally compiled into xterm as it duplicates functions that properly belong to window managers. It may, however, be enabled at the discretion of your system builder.

If enabled, the Windows menu is a special menu that is popped up when the ``control'' key and right button are pressed. Listed in order of bottommost to topmost are the visible windows on the display that are named. The checked entry is the current window. By selecting an entry, the corresponding window is raised to the top. This is very useful when a particular window of interest is obscured by many other windows.

OTHER FEATURES
Xterm automatically highlights the window border, text cursor and titlebar when the mouse enters the window (selected) and unhighlights them when the mouse leaves the window (unselected). If the window is the focus window, then the window is highlighted no matter where the mouse is.

The titlebar displays the name of the window in the center and on both sides stripes appear when the window is selected (highlighted). If both windows are showing, only the active window's titlebar is highlighted. If the left, middle or right button is pressed in the stripped section of the titlebar, the corresponding menu is popped up, without the need to hold down the ``control'' key. Pressing the mouse button in the center title of the titlebar causes the window to automatically iconify. Pressing a button in the icon deiconifies it. In addition, if input comes in while xterm is iconified and the icon is a static bitmap, a box is drawn around the icon title.

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 replace 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.

In either VT102 or Tektronix mode, there are escape sequences to change the title in the title bar (which will also change the name of the windows and icons) and to specify a new log file name.

By default, a miniature version of the VT102 or Tektronix window is displayed when xterm is iconified. The choice of which miniature to display is made when the full window(s) are iconified; if the Tek window is chosen in the iconify operation, then the icon will be a miniature Tek window and if the VT102 window is chosen, the icon will be a miniature VT102 window. This choice is independent of the current mode (Tektronix/VT102).

As an option, the miniature window may be disabled and a bitmap of a small VT102 window with titlebar and scrollbar can be displayed in the icon when in VT102 mode, and a bitmap of a Tektronix window with titlebar is displayed in Tektronix mode. these bitmaps may be user-defined (see options above).

ENVIRONMENT
Xterm sets the environment variables ``TERM'' and ``TERMCAP'' properly for the size window you have created. It also uses and sets the environment variable ``DISPLAY'' to specify which bit map display terminal to use. The environment variable ``WINDOWID'' is set to the X window id number of the xterm window.

SEE ALSO
resize(1), X(1), pty(4), tty(4)
``Xterm Control Sequences''

BUGS
There is currently no way for a xterm window not to highlight itself when the mouse cursor enter it while another window is the keyboard focus. There needs to be a dialog box to allow entry of log file name and the COPY file name. Many of the options are not resettable after xterm starts.

AUTHORS
Edward Moy (Berkeley), Ralph R. Swick (MIT-Athena), Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD), Jim Gettys (MIT-Athena), Bob Scheifler (MIT-LCS), Doug Mink (SAO).

VMS and TOPS-20 are trademarks of Digital Equipment Corporation.

Copyright (c) 1984, 1985, 1986 by Massachusetts Institute of Technology.
See X(1) for a full copyright notice.