Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

shelltool(1)

suntools(1)

textedit(1)

defaultsedit(1)

CMDTOOL(1)  —  USER COMMANDS

NAME

cmdtool − Run a shell (or other program) from the SunView text facility

SYNOPSIS

cmdtool [ −C ] [ −P n ] [ program [ args ] ]

DESCRIPTION

cmdtool is a standard tool provided with the SunView environment. 

When invoked, cmdtool runs a program (usually a shell) in a text-based command subwindow.  Typed characters are inserted at the caret.  If this program is a shell, it accepts commands and runs programs in the usual way. (See BUGS below). 

Text can be edited anywhere on the command line the same way as in any other text subwindow.  Commands and their output are kept in a log which can be scrolled using the scrollbar. The log file can also be edited, or even saved using the Save command in the text facility’s pop-up menu. The Split command, also in the pop-up menu, can be used to create two or more independently scrolling views of the log. 

DEFAULTS OPTIONS

/Tty/Append_only_log
TRUE is the standard default; it means that only the command line may be editted.  FALSE permits editting of the entire log.  See the descripton of Enable Edit below. 

/Tty/Insert_makes_caret_visible
This entry describes how hard the command subwindow should try to keep the caret visible.

Same_as_for_textIs the standard default; it means that the setting for Insert_makes_caret_visible will be taken from the Text category instead of Tty when a command subwindow is created. 

If_auto_scrollIf the caret is showing, and an inserted newline would position it below the bottom of the screen as determined by /Text/Lower_context, the text is scrolled to keep it showing.  The amount scrolled is controlled by /Text/Auto_scroll_by.  See textedit (1) for more information. 

AlwaysUpon any input action, if the caret is positioned off the screen, it is scrolled back into view. 

/Tty/Checkpoint_frequency
0 is the standard default; it means that no checkpointing will take place.  For a value n greater than zero, checkpointing will take place after every nth edit.  Each character typed, each Get, and each Delete counts as an edit.  If the transcript file is named /tmp/tty.txt.000xxx, at each checkpoint, an updated copy of the transcript will be saved in /tmp/tty.txt.000xxx%%. 

/Text/Edit_back_char
Set the character for deleting the character preceding the caret. Note: Stty erase has no effect; text based tools only refer to the defaults database.  The standard default is the DEL key. 

/Text/Edit_back_word
Set the character for deleting the word preceding the caret. Note: Stty werase has no effect; text based tools only refer to the defaults database.  The standard default is CTRL-W. 

/Text/Edit_back_line
Set the character for deleting from the newline preceding the caret to the caret.  Note: Stty kill has no effect; text based tools only refer to the defaults database.  The standard default is CTRL-U. 

COMMANDLINE OPTIONS

−C Redirect system console output to this instance of the cmdtool. This will prevent system error messages from being printed in unexpected places on the screen. Moreover, since a cmdtool window is scrollable, messages that go off the top of the window can be scrolled back for re-examination. 

−P nSet the checkPoint frequency to n. 

cmdtool also takes generic tool arguments; see suntools (1) for a list of these arguments. 

program [ args ]
If a program argument is present, cmdtool executes it.  Subsequent arguments will be assumed to be arguments of the program argument, and will be passed to it for execution.   If there are no arguments, cmdtool runs the program corresponding to the SHELL environment variable. If this environment variable is not available, then cmdtool runs /bin/sh. 

THE COMMAND SUBWINDOW

The subwindow of cmdtool is a command subwindow, which is also found in dbxtool and potentially in other tools as well.  The command subwindow is based on the text facility. For more information about the text facility, see Windows and Window-Based Tools: Beginner’s Guide.  The pop-up menu associated with command subwindow is the same as that for the text facility (see textedit (1)), with one additional item, Enable Edit.  The generic text menu items will not be described here except for Put, then Get, as it approximates the functionality of Stuff in shelltool (1), and is also implemented for shelltool. 

Put, then Get
When there is a selection, this item reads Put, then Get. It causes the selection to be copied both to the shelf and to the caret. 

Put, then Get
When there is no selection but there is text on the shelf, Put, then is grayed out, though Get remains active. Selecting this item causes the contents of the shelf to be copied to the caret.  When there is no selection and nothing is on the shelf, this item is inactive. 

Enable Edit
If the defaults entry Append_only_log is set to TRUE, but at some point you want to edit the log, selecting this menu item makes editting the log possible.  When the log is editable, this item reads Disable Edit, and selecting it makes the log read-only before the start of the command line. 

Certain text facility accelerators that are especially useful in command subwindows are described here. See textedit (1) for more information. 

CTRL-RETURN
Holding down the control key while typing newline (carriage return) positions the caret at the bottom and scrolls it into view, as determined by the defaults option /Text/Lower_context. 

CTRL-P
is an accelerator for the Put, then Get menu item described above. 

CAPS-lock
Bound to F1, it causes subsequent keyboard input to be uppercase. This key is a toggle; striking it a second time undoes the effect of the first strike.

FILES

/tmp/tty.txt.nnnnnn

~/.textswrc

SEE ALSO

shelltool(1), suntools(1), textedit(1), defaultsedit(1),

Windows and Window-Based Tools: Beginner’s Guide

BUGS

Full terminal emulation is not yet supported. Programs that use CBREAK or RAW mode, NO ECHO, or curses do not work as expected.  Some examples of manifestations of this deficiency include:

•To send a command to more other than newline, the desired command must be followed by CTRL-D. 

•vi comes up in open mode. 

•The ~h command in mail doesn’t work. 

•The password to su is echoed. 

•CTRL-C from a cmdtool running su but not started from a shell owned by root doesn’t work. 

•The select system call never notices input on stdin. 

•rlogin double echos and CTRL-D kills rlogin, not just the program running from it. 

Occasionally the program run from cmdtool unexplainably hangs. 

Sun Release 3.2  —  Last change: 30 September 1985

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