The VTxxx and Tektronix 4014 terminals each have their own window so that you can edit text in one and look at graphics in the other at the same time. To maintain the correct aspect ratio (height/width), Tektronix graphics will be restricted to the largest box with a 4014's aspect ratio that will fit in the window. This box is located in the upper left area of the window.
Although both windows may be displayed at the same time, one of them is considered the ``active'' window for receiving keyboard input and terminal output. This is the window that contains the text cursor. The active window can be chosen through escape sequences, the ``VT Options'' menu in the VTxxx window, and the ``Tek Options'' menu in the 4014 window.
Many of the special xterm features may be modified under program control through a set of escape sequences different from the standard VT102 escape sequences. (See the Xterm Control Sequences document.)
The Tektronix 4014 emulation is also fairly good. It supports 12-bit graphics addressing, scaled to the window size. Four different font sizes and five different lines types are supported. There is no write-through or defocused mode support. 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 ``COPYyyyy-MM-dd.hh:mm:ss'', where yyyy, 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).
Not all of the features described in this manual are necessarily available in this version of xterm. Some (e.g., the non-VT220 extensions) are available only if they were compiled in, though the most commonly-used are in the default configuration.
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. Saving of lines scrolled off the top of the window is 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 to restore the screen on exit. A popup menu entry makes it simple to switch between the normal and alternate screens for cut and paste.
In either VT102 or Tektronix mode, there are escape sequences to change the name of the windows. Additionally, in VT102 mode, xterm implements the window-manipulation control sequences from dtterm, such as resizing the window, setting its location on the screen.
Xterm allows character-based applications to receive mouse events (currently button-press and release events, and button-motion events) as keyboard control sequences. See Xterm Control Sequences for details.
The other options are used to control the appearance and behavior. Not all options are necessarily configured into your copy of xterm.
XtermLog.XXXXXX
or
Xterm.log.hostname.yyyy.mm.dd.hh.mm.ss.XXXXXX
depending on how xterm was built.
xterm -e /bin/bash -l -c "my command here"
-S123/45 -Sab34
The following command line arguments are provided for compatibility with older versions. They may not be supported in the next release as the X Toolkit provides standard options that accomplish the same task.
The following standard X Toolkit command line arguments are commonly used with xterm:
The following resources are specified as part of the vt100 widget (class VT100): These are specified by patterns such as "XTerm.vt100.NAME":
FontPath "/usr/lib/X11/fonts/misc/"
FontPath "/usr/lib/X11/fonts/misc/:unscaled"
*font:
- UTF-8 mode is initially off. Escape sequences for turning UTF-8 mode on/off are allowed.
- UTF-8 mode is initially on. Escape sequences for turning UTF-8 mode on/off are allowed.
- The command-line option -u8 sets the resource to this value. Escape sequences for turning UTF-8 mode on/off are ignored.
- This is the default value of the resource. It is changed during initialization depending on whether the locale resource was set, to 0 or 2. See the locale resource for additional discussion of non-UTF-8 locales.
The following resources are specified as part of the tek4014 widget (class Tek4014). These are specified by patterns such as "XTerm.tek4014.NAME":
The resources that may be specified for the various menus are described in the documentation for the Athena SimpleMenu widget. The name and classes of the entries in each of the menus are listed below. Resources named "lineN" where N is a number are separators with class SmeLine.
The mainMenu has the following entries:
The vtMenu has the following entries:
The fontMenu has the following entries:
The tekMenu has the following entries:
The following resources are useful when specified for the Athena Scrollbar widget:
Once the VT102 window is created, xterm allows you to select text and copy it within the same or 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. The assignment of the functions described below to keys and buttons may be changed through the resource database; see ACTIONS below.
Pointer button one (usually left) 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 and made the PRIMARY selection when the button is released. Double-clicking selects by words. Triple-clicking selects by lines. Quadruple-clicking goes back to characters, etc. 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. Logical words and lines selected by double- or triple-clicking may wrap across more than one screen line if lines were wrapped by xterm itself rather than by the application running in the window. If the key/button bindings specify that an X selection is to be made, xterm will leave the selected text highlighted for as long as it is the selection owner.
Pointer button two (usually middle) `types' (pastes) the text from the PRIMARY selection, if any, otherwise from the cut buffer, inserting it as keyboard input.
Pointer button three (usually right) extends the current selection. (Without loss of generality, you can swap ``right'' and ``left'' everywhere in the rest of this paragraph.) 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, i.e., 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 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 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 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 will change from an arrow to a cross. Pressing any key will send that key and the current coordinate of the cross cursor. Pressing button one, two, or three will return the letters `l', `m', and `r', respectively. If the `shift' key is pressed when a pointer button is pressed, the corresponding upper case letter is sent. To distinguish a pointer 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).
Xterm has four menus, named mainMenu, vtMenu, fontMenu, and tekMenu. Each menu pops up under the correct combinations of key and button presses. Each menu is divided into sections, separated by a horizontal line. Some menu entries correspond to 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. Other menu entries are commands; selecting one of these performs the indicated function.
All of the menu entries correspond to X actions. In the list below, the menu label is shown followed by the action's name in parenthesis.
The xterm mainMenu pops up when the ``control'' key and pointer button one are pressed in a window. This menu contains items that apply to both the VT102 and Tektronix windows. There are several sections:
The vtMenu sets various modes in the VT102 emulation, and is popped up when the ``control'' key and pointer button two are pressed in the VT102 window.
The fontMenu sets the font used in the VT102 window, or modifies the way the font is specified or displayed. There are three sections.
The first section allows you to select the font from a set of alternatives:
- Default (fontdefault)
- Set the font to the default, i.e., that given by the *VT100.font resource.
- Unreadable (font1)
- Set the font to that given by the *VT100.font1 resource.
- Tiny (font2)
- Set the font to that given by the *VT100.font2 resource.
- Small (font3)
- Set the font to that given by the *VT100.font3 resource.
- Medium (font4)
- Set the font to that given by the *VT100.font4 resource.
- Large (font5)
- Set the font to that given by the *VT100.font5 resource.
- Huge (font6)
- Set the font to that given by the *VT100.font6 resource.
- Escape Sequence
- This allows you to set the font last specified by the Set Font escape sequence (see the document Xterm Control Sequences).
- Selection (fontsel)
- This allows you to set the font specified the current selection as a font name (if the PRIMARY selection is owned).
The second section allows you to modify the way it is displayed:
- Line-Drawing Characters (font-linedrawing)
- When set, tells xterm to draw its own line-drawing characters. Otherwise it relies on the font containing these.
- Doublesized Characters (font-doublesize)
- When set, xterm may ask the font server to produce scaled versions of the normal font, for VT102 double-size characters.
The third section allows you to modify the way it is specified:
- TrueType Fonts (render-font)
- If the renderFont and corresponding resources were set, this is a further control whether xterm will actually use the Xft library calls to obtain a font.
- UTF-8 (utf8-mode)
- This controls whether xterm uses UTF-8 encoding of input/output. It is useful for temporarily switching xterm to display text from an application which does not follow the locale settings.
The tekMenu sets various modes in the Tektronix emulation, and is popped up when the ``control'' key and pointer button two are pressed in the Tektronix window. The current font size is checked in the modes section of the menu.
- Large Characters (tektextlarge)
- #2 Size Characters (tektext2)
- #3 Size Characters (tektext3)
- Small Characters (tektextsmall)
Commands:
- PAGE (tekpage)
- Clear the Tektronix window.
- RESET (tekreset)
- COPY (tekcopy)
Windows:
- Show VT Window (vtshow)
- Switch to VT Mode (vtmode)
- Hide Tek Window (tekhide)
X environments differ in their security consciousness. Most servers, run under xdm, are capable of using a ``magic cookie'' authorization scheme that can provide a reasonable level of security for many people. If your server is only using a host-based mechanism to control access to the server (see xhost(1) ), then if you enable access for a host and other users are also permitted to run clients on that same host, it is possible that someone can run an application which uses the basic services of the X protocol to snoop on your activities, potentially capturing a transcript of everything you type at the keyboard. Any process which has access to your X display can manipulate it in ways that you might not anticipate, even redirecting your keyboard to itself and sending events to your application's windows. This is true even with the ``magic cookie'' authorization scheme. While the allowSendEvents provides some protection against rogue applications tampering with your programs, guarding against a snooper is harder.
The possibility of an application spying on your keystrokes is of particular concern when you want to type in a password or other sensitive data. The best solution to this problem is to use a better authorization mechanism than is provided by X. Given all of these caveats, a simple mechanism exists for protecting keyboard input in xterm.
The xterm menu (see MENUS above) contains a Secure Keyboard entry which, when enabled, attempts to ensure 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. This ensures that you know which window is accepting your keystrokes. It cannot ensure that there are no processes which have access to your X display that might be observing the keystrokes as well.
Only one X client at a time can grab the keyboard, so when you attempt to enable Secure Keyboard it may fail. In this case, the bell will sound. If the Secure Keyboard succeeds, the foreground and background colors will be exchanged (as if you selected the Reverse Video entry in the Modes menu); they will be 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 gets displayed, and to make sure that the prompt gets 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.
Secure Keyboard mode will be disabled automatically if your xterm window becomes iconified (or otherwise unmapped), or if you start up a reparenting window manager (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 will be switched back and the bell will sound in warning.
This resource is a series of comma-separated of range:value pairs. The range is either a single number or low-high in the range of 0 to 65535, corresponding to the 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. When not in UTF-8 mode, only the first 256 bytes of this table will be used.
The default table starts as follows -
static int charClass[256] = {
/* 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 ! " # $ % & ' */
" <- for emacs autocolor to work well :-)
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,
/* x80 x81 x82 x83 IND NEL SSA ESA */
1, 1, 1, 1, 1, 1, 1, 1,
/* HTS HTJ VTS PLD PLU RI SS2 SS3 */
1, 1, 1, 1, 1, 1, 1, 1,
/* DCS PU1 PU2 STS CCH MW SPA EPA */
1, 1, 1, 1, 1, 1, 1, 1,
/* x98 x99 x9A CSI ST OSC PM APC */
1, 1, 1, 1, 1, 1, 1, 1,
/* - i c/ L ox Y- | So */
160, 161, 162, 163, 164, 165, 166, 167,
/* .. c0 ip << _ R0 - */
168, 169, 170, 171, 172, 173, 174, 175,
/* o +- 2 3 ' u q| . */
176, 177, 178, 179, 180, 181, 182, 183,
/* , 1 2 >> 1/4 1/2 3/4 ? */
184, 185, 186, 187, 188, 189, 190, 191,
/* A` A' A^ A~ A: Ao AE C, */
48, 48, 48, 48, 48, 48, 48, 48,
/* E` E' E^ E: I` I' I^ I: */
48, 48, 48, 48, 48, 48, 48, 48,
/* D- N~ O` O' O^ O~ O: X */
48, 48, 48, 48, 48, 48, 48, 215,
/* O/ U` U' U^ U: Y' P B */
48, 48, 48, 48, 48, 48, 48, 48,
/* a` a' a^ a~ a: ao ae c, */
48, 48, 48, 48, 48, 48, 48, 48,
/* e` e' e^ e: i` i' i^ i: */
48, 48, 48, 48, 48, 48, 48, 48,
/* d n~ o` o' o^ o~ o: -: */
48, 48, 48, 48, 48, 48, 48, 247,
/* o/ u` u' u^ u: y' P y: */
48, 48, 48, 48, 48, 48, 48, 48};
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 useful for cutting and pasting electronic mailing addresses and filenames.
^X ESC G <line+' '> <col+' '>