Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cmdtool(1) — SunCD Demo 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

defaultsedit(1)

rlogin(1C)

script(1)

shelltool(1)

sunview(1)

textedit(1)

vi(1)

curses(3V)

curses(3X)

CMDTOOL(1)  —  USER COMMANDS

NAME

cmdtool − run a shell (or program) using the SunView text facility

SYNOPSIS

cmdtool [ −C ] [ −M bytes ] [ −P count ] [ −B boldstyle ] [ −I command ] [ generic-tool-arguments ] [ program [ program-arguments ] ]

AVAILABILITY

Although this command is available with both the SunView software installation option and the OpenWindows user environment, its appearance is not the same for both environments.  The man page you are currently viewing refers to the cmdtool that is available with OpenWindows. The primary difference between this and the SunView cmdtool is the user interface.  All OpenWindows standard tools use the OPEN LOOK Graphical User Interface. For more information about the OPEN LOOK UI, refer to the OpenWindows User’s Guide.  For information about installing OpenWindows, refer to the OpenWindows Installation and Start-Up Guide. 

DESCRIPTION

cmdtool is the standard OpenWindows support facility for shells and other programs.  When invoked, cmdtool runs a program (usually a shell) in a text-based command window.  Characters typed on the keyboard are inserted at the caret.  If the program is a shell, that shell accepts and runs commands in the usual manner.  cmdtool also supports programs that perform cursor motions directly, such as vi(1). 

The text of the current command line can be edited using normal textedit(1) functions.  The command window displays a log of the session, which can be scrolled through using the scrollbar (unless the command does cursor motion).  This log can be edited, and saved by choosing the ‘Store as New File’ item in the text facility’s pop-up menu. 

OPTIONS

−C Console cmdtool.  Redirect system console output to this shelltool.  Display console messages in this cmdtool, which might otherwise appear in unexpected places on the workstation screen.  Since a cmdtool window can be scrolled, console error messages can be recorded for later examination. 

−M bytes Set the log to wrap-around after the indicated number of bytes.

−P count Checkpoint the log after every set of count editing operations. 

−B boldstyle Set the style for displaying bold text to boldstyle. boldstyle can be a string specifying one of the choices for the /Tty/Bold_style default, see Defaults Options, below, or it may be a numerical value for one of those choices, from 0 to 8, corresponding to the placement of the choice in the list. 

−I command Pass command to the shell.  SPACE characters within the command must be escaped. 
 
generic-tool-arguments cmdtool accepts the generic tool arguments listed in sunview(1). 

program [ program-arguments ]
If a program argument is present, cmdtool runs it and passes any remaining arguments to that program. If no program is given, cmdtool runs the program indicated by the SHELL environment variable, or /usr/bin/sh by default. 

USAGE

Defaults Options

The following options can be configured as default settings using defaultsedit(1). 

Term.EnableEdit:
When set to TRUE (the standard default) only command lines can be edited.  FALSE allows the entire log to be edited.  (See also the description of Enable Edit below.) 

Text.InsertMakesCaretVisible:
This entry allows you to specify the method for displaying the editing caret.

Same_as_for_text
Use the setting specified in the defaults for the Text category (the standard default). 

If_auto_scroll If 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 the caret showing.  The number of lines scrolled is determined by the /Text/Auto_scroll_by default.  (See textedit(1) for more information.) 

Always Scroll the caret back into view whenever input would position it off the screen. 

Text.CheckpointFrequency:
If set to 0 (the standard default) no checkpointing is done.  For any value greater than zero, a checkpoint is made each time the indicated number editing operations has been performed since the last checkpoint.  Each character typed, each Paste, and each Cut counts as an editing operation.  At each checkpoint, an updated copy of the log is saved in a file with a name that is constructed by appending two percent signs (%%) to the name of the log file.  By default, the log file has a name of the form /tmp/tty.txt.pid (pid is the process ID number of cmdtool); the corresponding checkpoint file has a name of the form /tmp/tty.txt.nnnnnn%%. 

Text.MaxLogFileSize:
If set to 0 (the standard default) no wrap-around takes place; the log file grows without a specified limit.  For values greater than zero, wrap-around occurs whenever the indicated number of characters have been written to the log since the last wrap-around.  Characters that are pushed over the top are replaced by the message:

∗∗∗ Text is lost because the maximum edit log size has been exceeded. ∗∗∗

Keyboard.DeleteChar:
Set the character for erasing to the left of the caret. Note: in cmdtool, the ‘stty erase’ command has no effect.  Text-based tools refer only to the defaults database key settings.  The default is DELETE. 

Keyboard.DeleteWord:
Set the character for erasing the word to the left of the caret. The standard default is CTRL-W. 

Keyboard.DeletetoLine:
Set the character for erasing all characters to the left of the caret.  Note: ‘stty kill’ has no effect in cmdtool.  The standard default is CTRL-U. 

cmdtool Windows

The window created by cmdtool is based on the text facility that is described in the textedit man page.  The user is given a prompt at which to type commands and pop-up menus from which to select command options. 

cmdtool windows support cursor motions, using an /etc/termcap entry called sun-cmd.  Command windows automatically set the TERM environment variable to sun-cmd.  So, if you rlogin(1C) to a machine that does not have an entry for sun-cmd in its /etc/termcap file, the error message ‘Type sun-cmd unknown’ results.  To rectify this, type the command ‘set TERM=sun’.  Programs written using the curses(3X) or curses(3V) library packages will work in a command window, but programs hard-coded for sun-type terminals may not.  When supporting a program that performs cursor motions, the command window automatically takes on the characteristics of a tty window (as with shelltool(1)).  When that program terminates or sleeps, the full command window functionality is restored. 

cmdtool supports programs that use CBREAK and NO ECHO terminal modes.  This support is normally invisible to the user.  However, programs that use RAW mode, such as rlogin(1C) and script(1), inhibit command-line editing with the mouse.  In this case, however, tty-style ERASE, word-kill and line-kill characters can still be used to edit the current command line. 

The cmdtool Menu

The cmdtool window menu is called the Term Pane menu and contains the following options and their submenus:

History

Creates a a list of commands used during the cmdtool session

Edit >

Provides a set of editing functions as described below:
 
Again

Repeats the last action. 

Undo >

Undo Last Edit

Undoes the last edit made in cmdtool. 

Undo All Edits

Undoes all edits made during this session of cmdtool. 

Copy

Makes a copy of the selected text and places it in the clipboard. 

Paste

Pastes a copy of the text stored in the clipboard at the cursor location. 

Cut

Deletes the selected text and places it in the clipboard. 

Find >

Provides a set of find and replace functions as described below:
 
Find and Replace

Brings up a pop-up menu containing text fields and command buttons that allow you to search forward and backward through the file being edited for specific text strings. Allows you to specify options for the replacement of text. 

Find Selection >

Forward

Searches forward to find a selected text string. 

Backward

Searches backward to find a selected text string. 

Find Marked Text

Brings up a pop-up menu that allows you to find text that is included between specified bracket pairs. Also allows you to insert or remove bracket pairs around selected text. 

Replace |>field<| >

Allows you to replace selected text forward and backward throughout the file. 

Extras >

A user-definable pull-right menu conrolled by the /usr/lib/text_extras_menu file. 

File Editor >

Enable

Allows you to edit files from within cmdtool. 

Disable

Turns off the ability to edit files from within cmdtool. 

Scrolling >

Enables scrolling within cmdtool. 

Disable Scrolling >

Turns off the ability to scroll within cmdtool.  Once scrolling in cmdtool is disabled, it’s functionality is identical to shelltool and a more restricted menu appears. Selecting the Enable Scrolling option from the restricted menu restores the full menu and functionality of cmdtool. 

 

Accelerators

Text facility accelerators that are especially useful in command windows are described here.  See
textedit(1) for more information. 

CTRL-RETURN Position the caret at the bottom, and scroll it into view as determined by Text.LowerContext. 

CAPS-lock

Toggle between all-upper-case keyboard input, and mixed-case. 

FILES

/tmp/tty.txt.pid log file

~/.textswrc

~/.ttyswrc

usr/lib/.text_extras_menu

$HOME/.TextExtraMenu

/etc/termcap

/usr/bin/sh

SEE ALSO

defaultsedit(1), rlogin(1C), script(1), shelltool(1), sunview(1), textedit(1), vi(1), curses(3V), curses(3X)

Installing SunOS 4.1
SunView User’s Guide

BUGS

Typing ahead while cmdtool changes between its scrollable and cursor motion modes will sometimes freeze cmdtool . 

Full terminal emulation is not complete.  Some manifestations of this deficiency are:

• File completion in the C shell does not work. 

• Enhanced display of text is not supported. 

Sun Release 4.1  —  Last change: 1 September 1989

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