SHELLTOOL(1) — USER COMMANDS
NAME
shelltool − Run a shell (or other program) in the SunView environment
SYNOPSIS
shelltool [ −C ] [ −B boldstyle ] [ −I command ] [ program [ args ]]
DESCRIPTION
shelltool is a standard tool provided with the SunView environment.
When invoked, shelltool runs a program, (usually a shell) in an interactive terminal emulator based on a tty subwindow. Keystrokes typed to the shelltool are passed to the program running in the shelltool. If this program is a shell, it accepts commands and runs programs in the usual way. For its scrolling and editting capabilities, you may prefer to use cmdtool instead of shelltool. See cmdtool(1), suntools(1), Terminal Emulators, and Windows and Window-Based Tools: Beginner’s Guide for more information.
To run graphics programs, use gfxtool — see gfxtool(1).
DEFAULTS OPTIONS
/Tty/Bold_style
For programs that use emphasized text, shelltool supports bolding as well as inverse video. To set the emphasis style, choose the category Tty in defaultsedit and choose one of the following for the Bold_style entry:
Nonedisables emphasis
Offset_Xthicken character horizontally
Offset_Ythicken character vertically
Offset_X_and_Ythicken character both horizontally and vertically
Offset_XYthicken character diagonally
Offset_X_and_XYthicken character both horizontally and diagonally
Offset_Y_and_XYthicken character both vertically and diagonally
Offset_X_and_Y_and_XY
thicken character horizontally, vertically and diagonally
Invertdisplay emphasis as inverse video, the standard default
/Tty/Retained
No is the standard default; it specifies that tty subwindows are not retained. If Yes is chosen, tty subwindows are retained; this enhances display speed at the expense of memory consumption. Repaint speed when the window is uncovered is greatly enhanced.
COMMANDLINE OPTIONS
−CRedirect system console output to this instance of the shelltool.
−B boldstyle
Sets the boldstyle for this instance of shelltool. Boldstyle may be any of the choices for the defaults database entry for /Tty/Bold_style, or it may be a number from 0 to 8. The numbers mean:
0None
1Offset_X
2Offset_Y
3Offset_X_and_Y(means Offset_X | Offset_Y)
4Offset_XY
5Offset_X_and_XY(means Offset_X | Offset_XY)
6Offset_Y_and_XY(means Offset_Y | Offset_XY)
7Offset_X_and_Y_and_XY (means Offset_X | Offset_Y | Offset_XY)
8Invert
−I command
Input a command to the shell. Spaces in the command must be escaped.
shelltool also takes generic tool arguments; see suntools(1) for a list of these arguments.
If a program argument is present, shelltool runs it. If there are no arguments, shelltool runs the program corresponding to your SHELL environment variable. If this environment variable is not available, then shelltool runs /bin/sh.
THE TERMINAL EMULATOR
The tty subwindow of shelltool is a terminal emulator. Whenever a tty subwindow is created, the startup file ~/.ttyswrc is parsed for tty subwindow-specific parameters. A sample .ttyswrc file may be found in /usr/lib/ttyswrc. The command format of this file is:
#Comment.
set variableTurn on the specified variable.
mapi key textWhen key is typed pretend text was input.
mapo key textWhen key is typed pretend text was output.
The only currently defined "variable" is "pagemode". "Key" is one of L1-L15, F1-F15, T1-T15, R1-R15, LEFT, or RIGHT (see note below). "Text" may contain escapes such as \E, \n, ^X, etc. (escape, newline, control-X, respectively). See termcap(5) for the format of the string escapes that are recognized. Note that "mapi" and "mapo" may be replaced by another keymapping mechanism in the future.
NOTE: When using the default kernel keyboard tables, the keys L1, LEFT, RIGHT, BREAK, R8, R10, R12, and R14 cannot be mapped in this way because they send special values to the tty subwindow. Also, when using the default kernel keyboard tables, L1-L10 are now used by SunView. See setkeys(1) and kbd(5) for more information on how to change the behavior of the keyboard.
It is possible to have terminal-based programs drive the tool in which its tty subwindow resides by sending it special escape sequences. These escape sequences may also be sent by typing a key appropriately mapped using the "mapo" function described above. The following functions pertain to the tool in which the tty subwindow resides, not the tty subwindow itself.
\E[1t− open
\E[2t− close (become iconic)
\E[3t− move, with interactive feedback
\E[3;TOP;LEFTt− move, to TOP LEFT (pixel coordinates)
\E[4t− stretch, with interactive feedback
\E[4;WIDTH;HTt− stretch, to WIDTH HT size (in pixels)
\E[5t− expose
\E[6t− hide
\E[7t− refresh
\E[8;ROWS;COLSt− stretch, to ROWS COLS size (in characters)
\E[11t− report if open or iconic by sending \E[1t or \E[2t
\E[13t− report position by sending \E[3;TOP;LEFTt
\E[14t− report size in pixels by sending \E[4;WIDTH;HTt
\E[18t− report size in characters by sending \E[8;ROWS;COLSt
\E[20t− report icon label by sending \E]Llabel\E\
\E[21t− report tool header by sending \E]llabel\E\
\E]l<text>\E\− set tool header to <text>
\E]I<file>\E\− set icon to the icon contained in <file>;
<file> must be in iconedit output format
\E]L<label>\E\− set icon label to <label>
\E[>OPT;...h− turn OPT on (OPT = 1 => pagemode), e.g., \E[>1;3;4h
\E[>OPT;...k− report OPT; sends \E[>OPTl or \E[>OPTh for each OPT
\E[>OPT;...l− turn OPT off (OPT = 1 => pagemode), e.g., \E[>1;3;4l
As an example of using this facility, the following aliases can be put into your ~/.cshrc file:
# dynamically set the name stripe of the tool:
alias header ’echo -n "\E]l\!∗\E\"’
# dynamically set the label on the icon:
alias iheader ’echo -n "\E]L\!∗\E\"’
# dynamically set the image on the icon:
alias icon ’echo -n "\E]I\!∗\E]\"’
Selections
Terminal subwindows support a facility called selection, which provides for limited inter-tool communication and mouse-oriented text manipulation. A selection is a span of characters which you can manipulate. To make a selection:
•Press the select (left) mouse button while the tip of the cursor is over the desired character. Your selection becomes highlighted (video inverted). This feedback helps you see what you’re doing. Any previous selections in any window are de-selected; the highlighting around the old selection disappears. Move the mouse with the select button down, and the selection changes. Release the select button to complete the selection.
•Press the adjust (middle) mouse button down and move the mouse to change the span of characters that you select. Release the button. All characters, from the ones you originally selected through the one indicated when you released adjust, are selected. The highlighting indicating the selection adjusts to reflect its new contents.
You can also adjust your selection by multi-clicking. If clicks are less than .5 seconds apart, they combine into a multiple click. For example, if you click twice on a character, the highlighting adjusts to select a word (non-white-space delimited by white-space). Click three (3) times, and the highlighting adjusts to select a line. You can select characters obscured by another window if they lie between the characters you chose as the endpoints to the selection. The selection is deselected if you type any key or any new output is written to the window which holds the selection.
Menu
To manipulate your selection, press the menu button over the terminal subwindow. A ttysw menu appears with the menu items discussed below:
Put, then Get
When there is a selection in any window, this item reads Put, then Get. Selecting it copies the selection both to the shelf and to the insertion point (cursor). It copies selections in tty, text, command, and panel subwindows. It is intended to bridge the gap between Stuff and the new selection functionality (see Windows and Window-Based Tools: Beginner’s Guide and cmdtool(1)).
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 insertion point (cursor). When there is no selection and nothing on the shelf, this item is inactive.
Enable Page Mode
Select Enable Page Mode to prevent voluminous tty subwindow output from scrolling off the screen. Page Mode can save you from redoing a command with a pipe to more in such cases.
When Page Mode is on, the cursor becomes a tiny stop sign when a command generates a screenful of output. To restart output, type any key, or select the Continue menu item, which temporarily replaces Enable Page Mode . When there is no output waiting to be shown, the cursor remains in the shape of an arrow, and Disable Page Mode replaces Enable Page Mode in the menu.
Stuffis provided for backward compatibility. Select Stuff, and the characters in the selection are copied to the insertion point (cursor) as though they had been typed at the keyboard. The window in which you invoke Stuff does not have to be the same as the one in which you made the selection, but the selection does have to be in a tty subwindow.
Flush Input
This item does not always appear in the menu. Occasonally the input buffer fills up and the terminal emulator appears to freeze. If this happens to you, Flush Input will appear in the menu. Selecting it will clear the buffer and allow you to continue using the terminal emulator.
SEE ALSO
suntools (1), gfxtool (1), cmdtool(1), defaultsedit(1), Windows and Window-Based Tools: Beginner’s Guide
FILES
~/.ttyswrc
/usr/lib/ttyswrc
/usr/bin/shelltool
/usr/bin/suntools
/usr/demo/∗
/usr/src/sun/suntool/shelltool.c
BUGS
This release has the following notable bugs:
(1)Remote login to another machine should be done with a terminal emulator subwindow matching the standard terminal size for the remote machine (for example, 34 by 80 characters for a Sun workstation). The remote machine does not understand terminals with non-standard size.
(2)If more than 256 characters are input to a terminal emulator subwindow without an intervening newline, the terminal emulator may hang. If this occurs, display the tty subwindow menu; it contains the item, "Flush input", that you can invoke to correct the problem. ~
Sun Release 3.2 — Last change: 30 September 1985