NAME
tx - Scrollable terminal emulator for X

SYNOPSIS
tx [options]

OPTIONS

-bd color
    Use color as the border color for the window. If this switch isn't given then the borderColor X default is used. If it isn't given either, then the foreground color is used.

-bg color
    Use color as the background color for the window. If this switch isn't given then the background X default is used. If it isn't given either, or if the display is a black-and-white one, then White is used.

-D  Causes tx not to detach itself from its parent process.

-display host:display
    Use host and display as an indication of the display on which to open the window. The display defaults to the one specified in the DISPLAY environment variable.

-fg color
    Use color as the foreground color for the window. If this switch isn't given then the foreground X default is used. If it isn't given either, or if the display is a black-and-white one, then Black is used.

-fn font
    Use font as the font for the window. If this switch isn't given, then the font X default is used as the font. If it isn't given either, then the Sx default font is used.

-geometry geometry
    Use geometry as the geometry for the window. If no geometry is specified on the command line, it the geometry defaults to the value of the geometry X default. If no default is specified, then tx picks a geometry.

-help
    Print out a list of the command-line options (and brief descriptions of their functions) and exit without opening a window.

-icon file
    File is the name of a file in bitmap format. Read the file and use it as the icon for the window. If file is localhost, then tx chooses the default icon file corresponding to the local host.

-ix xcoord
    Display the icon at x-coordinate xcoord.

-iy ycoord
    Display the icon at y-coordinate ycoord.

-sb color
    Use color as the background color for the window's scrollbar. If this switch isn't given then the scrollbar.background X default is used. If it isn't given either, then the background color for the text window is used.

-se color
    Use color as the color for the window's scrollbar elevator. If this switch isn't given then the scrollbar.elevator X default is used. If it isn't given either, then the background color for the text window is used.

-sf color
    Use color as the foreground color for the window's scrollbar. If this switch isn't given then the scrollbar.foreground X default is used. If it isn't given either, then the foreground color for the text window is used.

-showtitle
    Display a title bar at the top of the window. Tx normally assumes that a window manager will display a title bar; if your window manager doesn't, you may wish to use this switch. If this switch isn't specified, then Tx checks for a showTitle X default; if it exists and contains the string ``yes'', then a title bar will be displayed.

-tb color
    Use color as the background color for the window's title bar. If this switch isn't given then the title.background X default is used. If it isn't given either, then the background color for the text window is used. This option is ignored if Tx isn't displaying a title bar.

-tf color
    Use color as the foreground color for the window's title bar. If this switch isn't given then the title.foreground X default is used. If it isn't given either, then the foreground color for the text window is used. This option is ignored if Tx isn't displaying a title bar.

-ts color
    Use color as the color for the window's title stripes. If this switch isn't given then the itle.stripe X default is used. If it isn't given either, then the foreground color for the text window is used. This option is ignored if Tx isn't displaying a title bar.

-title name
    Display name in the title bar for the window. The default title is the name of the pseudo-terminal associated with the window.

=geometry
    Use geometry as the geometry specifier for the window (same effect as the -geometry option).

host:display
    Use this argument to select the display on which to create the window (same effect as the -display option).

-e command
    This switch must be the last one, if it is present. The arguments following the -e switch constitute the command to execute in the window. Command is run using the terminal emulator for standard input and standard output. When the command completes, the window will be destroyed and tx will exit. The default command is ``/bin/csh -i'', or if a SHELL environment variable is defined, then it is invoked with a -i argument.

INTRODUCTION
Tx is a terminal emulator that uses the facilities of the X window system, the Sx supplementary library, and the Tcl command interpreter. It executes a command (usually a shell) and arranges for the command's standard input and standard output streams to be directed from/to a pseudo-terminal controlled by tx. Tx, in turn, displays a scrollable window in more-or-less the same way as mx; output from the application is displayed in the window and keystrokes typed in the window are passed through to the application. Tx windows emulate a very simple terminal with enough facilities to run programs like vi.

The implementation of tx is very similar to that of mx; it shares much of the code and many of the commands. You should read the mx manual page before reading this one, in order to learn about the basic command interface and the mx commands. Tx commands that are identical to mx commands are not documented here except by reference to the mx manual page.

.TX FILES
After processing command line options and opening the window, tx checks for the existence of a file ``.tx'' in your home directory (environment variable HOME). If the file exists, tx reads it in and processes it as a command file, just as if it were read with the source command. Then it checks for a .tx file in the current directory, and processes it if it exists.

SELECTION
Selection in tx is identical to that in mx, except for one difference. In tx the caret always appears at the end of the typescript, except when the typescript is in vi mode (see the vi command); there is no way to reposition the caret with the mouse.

VARIABLES
See the mx manual page for overall information. The special variables defined by tx are:

    args
        Set by tx to hold the arguments to the current variable being executed, if any.

    height
        Set by tx to hold the height of the window, in lines of text. If the last line appearing in the window is only partially visible, it doesn't count.

    searchCmd
        When the middle button is clicked in the ``Search'' string entry, or when carriage-return is typed there, the contents of this variable are executed as a command.

    searchString
        Set by tx to hold the contents of the search entry subwindow.

    termcap
        Set by tx to hold a termcap entry that provides enough functionality to run Vi and other prehistoric screen-based programs. It's based on a terminal type ``tx''. This variable is automatically reset whenever the window changes size.

    version
        Set by tx to hold a version number in the form x.y, where changes in x correspond to major revisions with probable incompatibilities, and changes in y represent small bug fixes and upgrades that should not cause substantial compatibility problems.

    width
        Set by tx to hold the width of the window, in characters. If the last character position is only partially-visible, then it doesn't count. If a variable-width font is being used, the average character size is used in computing the window's width.

    windowId
        Set by tx to hold the X window identifier for this window.

MARKS
See the mx manual page for documentation. The same special marks are defined in tx as in mx.

COMMANDS
Tx is based around the Tcl interpreter just as mx is. Each keystroke or menu selection is bound to a Tcl command string, which is passed to the Tcl interpreter for execution. See the Tcl man page for details on the built-in commands provided by Tcl. In addition to them, tx provides the following additional built-in commands. Many of them are identical to the corresponding commands in mx.

bind [sequence [command]]
    Same as in mx.

caret operand
    Same as in mx.

control option string
    Same as in mx.

delete mark1 [mark2]
    Same as in mx.

escape option
    If option is on, this command enables escape sequences in window output: whenever tx finds an escape character (338) in the stream of characters output to the pseudo-device for display in the window, it discards the escape sequence and interprets the following characters (up to and including the next newline character) as a tx command rather than characters to be displayed in the window. If option is off, escape sequences are disabled: they will be output to the window just like any other characters. Escape sequences are enabled by default in tx, and must be enabled for the TERMCAP mechanisms to work. This command is most useful to temporarily disable escape-processing while running programs that generate meaningless escape sequences.

extract mark1 [mark2]
    Same as in mx.

focus window [clear]
    Same as in mx.

geometry spec
    Same as in mx.

insert bytes bytes ...
    Send bytes to the application as keyboard input on the pty. If more than one bytes argument is supplied, each is input in turn, with a single space between them.

mark src op args
    Same as in mx.

menu option args
    Same as in mx.

message string
    Same as in mx.

mxopen [options] file file ...
    Same as open command in in mx. Used to create an mx window from tx, e.g. to display variable values.

mxsend window command
    Same as in send command in mx. Used to send commands to mx windows created from tx.

open [options]
    Open a new tx window. The options to this command are exactly the same as the command-line options for the tx program, with the following exceptions. If the -e switch is given, then a new typescript is created and all the remaining arguments to open are used as a command name and arguments for the top-level application in the new typescript. If the -e option is not given, then the new window will provide an alternate view on the same typescript as the invoking window. The -D option is not permitted, nor are options that specify a display. If no geometry specification is given in options, then tx uses the contents of the global variable geometry as a default geometry; if no geometry variable exists, then tx picks a default geometry. Other options, such as foreground color and font, default to the values from the invoking window, rather than looking for X defaults. Open sets the global variable newWindow to hold the id of the newly-created window. This may be used in conjunction with the send command to issue commands to the new window. The return value is always an empty string.

output bytes
    Insert bytes in the output display as if they had been output by the application.

quit
    Destroy the tx window and end the program.

quote
    Same as in mx.

search [direction [pattern]]
    Same as in mx.

see mark [top|center|bottom]
    Same as in mx.

selection option [arg ...]
    Same as in mx.

send window command
    Same as in mx.

title left center right wmName
    Change the title information for the window. Left will be displayed at the left side of the title bar, center in the middle of the bar, and right at the right side of the title bar. If any of these three arguments is an empty string, then nothing will be displayed in the corresponding position. The string given by wmName will be recorded as the window's name for the window manager. This name will probably appear when the window is iconified, for example. If Tx isn't displaying a title for the window, then only the wmName argument will be used.

update
    Same as in mx.

vi option args
    This command provides an alternate mode of operation, called ``vi mode'', which provides sufficient terminal emulation to run the vi editor. When the window is in vi mode, an additional window-full of blank lines (called the vi area) is added at the beginning (top) of the typescript, and the view is shifted to display those lines. Most of the vi commands are used only in the crude termcap entry that tx provides for itself. The vi command must have one of the following forms:

    vi enter
        Enter vi mode. Fill the vi area with blank lines, change the window's view to display those lines, and move the caret to position 0.0.

    vi leave
        Leave vi mode. Delete the lines in the vi area, move the caret back to the end of the typescript, and change the window's view to display the end of the typescript.

    vi cd
        Clear all the lines on the screen at or below the caret position, leaving the caret at the beginning of its (now-blank) line. This command is provided primarily for emulating the cd termcap entry.

    vi ce
        Clear from the caret position to the end of the line, leaving the caret where it is. This command is provided primarily for emulating the ce termcap entry.

    vi clear
        Clear the lines in the vi area and move the caret to the home position (0.0).

    vi cursor lineIndex charIndex
        Set the caret position to line lineIndex, character charIndex. This position must lie within the via area.

    vi deleteline
        Delete the line containing the caret, and add a new line to the bottom of the vi area to keep the total number of lines in the via area constant.

    vi insertline
        Add a new blank line to the vi area, just before the caret (the caret should be at the beginning of a line). Delete the last line in the vi area, in order to keep the total number of lines in the vi area constant.

    vi on
        Returns a non-zero string if the window is currently in vi mode, and a zero string otherwise.

    vi tab
        Move the caret to the next tab stop.

    vi up
        Move the caret up one line.

COMMAND PROCEDURES
In addition to the built-in commands described above, a number of Tcl command procedures are created by the default tx startup file. They may be invoked just like built-in commands, and are described below.

showBindings binding binding ...
    Same as in mx.

showMenus name name ...
    Same as in mx.

showProcs name name ...
    Same as in mx.

showVars name name ...
    Same as in mx.

where
    Same as in mx.

TERMCAP INFORMATION
Tx stores an up-to-date termcap entry in the termcap variable, and initializes the TERM and TERMCAP environment variables when it starts up, so that you can run programs that use termcap information. If you change the size of a tx window, tx will update the termcap variable and invoke the TIOCSWINSZ ioctl to notify the application, but it cannot update the TERM and TERMCAP environment variables in the application; you can use the ``Set Termcap'' menu entry to invoke shell commands to update TERM and TERMCAP. If you use tx to rlogin to a different machine, most machines have never heard of tx so they don't have entries for it in their /etc/termcap files. There are two possible solutions to this problem: a) you can invoke the ``Set Termcap'' menu entry after you've gotten logged in to the remote machine; b) you can use the txinfo program as part of your .login shell script, in order to set up the TERMCAP automatically. See the manual page for txinfo for details.

COMMAND SUBWINDOW
Same as in mx.

MULTIPLE WINDOWS ON SAME TYPESCRIPT
The open command may be used to open several windows on the same typescript. The windows behave identically except for one thing: window size. There is a single window size associated with the typescript, which is returned when applications perform TIOCGWINSZ ioctl operations on the pseudo-terminal. If the different windows have different sizes, then Tx always uses the size from a particular one of the windows (usually the first window created on the typescript). The other windows are labelled Alternate at the right side of their title bars to indicate that their sizes will not be reflected to the application.

SEE ALSO
mx, txcmd, txinfo

KEYWORDS
mouse, terminal emulator, typescript, window