OpenWindows User's Guide

Chapter 6 Command Tool, Shell Tool, and Console Window

This chapter provides information about the Command Tool, Shell Tool, and Console Window (or Console). These tools are essentially the same application, but display different default pane pop-up menus. The Command Tool is an enhanced Shell Tool.

Command Tool and Shell Tool are standard OpenWindows shells, or terminal emulators, that interpret commands typed in UNIX. When you use one of these applications it is as if you are working at a terminal, rather than in a complex networked windowing environment. The advantage is that you can display many other windows and continue running other applications at the same time.

These tools are useful if you need to:

The Console is a special Command Tool designated for displaying error and system messages sent by the SunOS operating system, the OpenWindows environment, and some applications.

Command Tool

Command Tool provides a scrolling pane that acts as an editable command interpreter and can also provide a standard text editing pane. It can be used for a variety of tasks, including moving around in your file system, composing and editing files, and communicating with the operating system.

    To open a Command Tool, choose Workspace -> Programs -> Command Tool.

Figure 6-1 shows an open Command Tool window. The Command Tool icon looks the same as the Shell Tool icon shown in Figure 6-4.

Figure 6-1 Command Tool Window


A Command Tool window has a header with a Window menu button, a Window menu, resize corners, a scrollbar, and a text/terminal emulator pane.

For more information on these elements, refer Chapter 1, Introduction to the Solaris User Environment.

Command Tool Term Pane Menu

In a Command Tool, the Term Pane pop-up menu has the Edit, Find, and Extras items of the standard text editing pop-up menu (described in Chapter 3, Text Editor), plus three additional items: the History, File Editor, and Scrolling submenus. Move the pointer anywhere onto the Command Tool pane and press MENU to display the Term Pane menu.

History Submenu

The History of a Command Tool is a log of all the characters displayed. You can access this log by scrolling the Term Pane with the scrollbar or by saving the log to a file. This may be useful, for example, if you have performed a complicated sequence of operations that you want to save or send as part of a mail message for troubleshooting or debugging. The History submenu provides options to modify the history log.

The Mode setting determines whether the history log is Editable within the Command Tool, or Read Only. If you set the mode to Read Only in order to protect against accidental changes, you can still save the log to a file and edit that file using the File Editor option described in the next section. If the mode is editable, you can edit text anywhere in the Term Pane and use the editing items on the Term Pane menu. See Chapter 3, Text Editor for information on the editing functions.

    Choose Store log as new file to save the current history log to a file.

When you choose this option, the Text: Save As window is displayed. For complete information on saving files refer to Chapter 1, Introduction to the Solaris User Environment.

You can treat this new file as you would any other text file. You can edit it and save it again or drag and drop it from the File Manager onto a Mail Tool Compose or Text Editor window.

    Choose Clear log to clear the current history log.

This resets the Command Tool history log as if you just started the Command Tool application. (This does not change the output of the UNIX history command.)

File Editor Submenu

The items on the File Editor submenu determine whether a Text Editor Pane is displayed. When you enable the File Editor, the Command Tool is split into two panes: a Command Tool pane and a Text Editor pane. The Text Editor pane is described in Chapter 3, Text Editor. Figure 6-2 shows a Command Tool with the File Editor enabled.

Figure 6-2 Command Tool with the File Editor


Scrolling Submenu

The choice from the Scrolling submenu of the Command Tool Term Pane menu determines whether a scrollbar is displayed. When you disable scrolling, the Command Tool acts like a Shell Tool.

Typing Commands in Command Tool

You can access all of the files and directories in your file system from the Command Tool. Use of the Command Tool requires familiarity with the operating system and with your file system.

In the sample session that follows, the cd command changes directories to your home directory, the mkdir command creates a new directory there, and the cp command copies that directory to a new directory with a different name. You execute each command when you press Return at the end of the command line.

example% cd (Press Return)
example% mkdir Directory1 (Press Return)
example% cp -r Directory1 Directory2 (Press Return)

Viewing Your Command History

The Command Tool is a scrolling window. The scrollbar at the side of the window enables you to go back and view commands that are no longer visible in the window. You can scroll back to see the commands typed during the entire life of the window.

Editing the Command Line

In the Command Tool, the command line can be edited. You can move the pointer to any location on the command that you have typed and click SELECT to position the insert point there. You can then type in that location or erase the previously typed characters and retype that portion of the command. Figure 6-3 shows the insert point.

Figure 6-3 Insert Point in a Command Line


Editing Text with Command Tool

Command Tool can be used as a Text Editor window at any time. The advantage to this is that you do not need to know a command line editor such as vi. To enable the Command Tool text editing window, move the pointer onto the window pane, press the MENU button, drag the pointer down to highlight File Editor, and then to the right to highlight Enable. The Command Tool pane splits in two; the top pane remains as Command Tool, while the bottom pane becomes a Text Editor.

See the "Text Editor" section for an introduction to the commands in the Command Tool File Editor.

    To return to the basic Command Tool, position the pointer in the top pane and choose File Editor -> Disable.

Shell Tool

Like Command Tool, Shell Tool is a window that you use to communicate with the operating system, or to move around in your file system and compose and edit files by command line. You can use Shell Tool for shells or other programs that employ a standard teletype (TTY) interface.

The basic differences between Command Tool and Shell Tool are:

    To open a Shell Tool window, choose Workspace -> Programs -> Shell Tool.

Note -

Open as many Shell Tools as you need, but remember that as you add more applications to the Workspace, you may compromise system performance.

Figure 6-4 shows the Shell Tool icon and Figure 6-5 shows an open Shell Tool window.

Figure 6-4 Shell Tool Icon


Figure 6-5 Shell Tool Window


A Shell Tool window has a header with a Window menu button, a Window menu, resize corners, and a terminal emulator pane. A Shell Tool window does not have a scrollbar at start up, but you can enable scrolling if desired. The insert point is shown by a block cursor. When the insert point is not in the Shell Tool, the block cursor is displayed as an outline of the block cursor. Editing is limited to the end of the current line. For example, you can only delete characters on the current line. Once you press Return, the characters on the line are interpreted as a command. If you are not familiar with these window elements, refer to Chapter 1, Introduction to the Solaris User Environment.

Shell Tool Term Pane Menu

    To display the Shell Tool terminal emulator pane menu, move the pointer anywhere into the Shell Tool pane and press MENU.

    Choose Enable Page Mode to display only one page or pane of text at a time, just as the UNIX more command does.

    The pointer changes to a stop sign when the window fills up, as shown in Figure 6-6.

    Figure 6-6 Shell Tool Stop Sign Pointer


    Instead of displaying continuing text in the window, the display stops so that you can look at it as long as you like. The Enable Page Mode item on the Term Pane pop-up menu changes to Continue when there is more information that you can display.

    When you want to see the next pane, press any key or choose Continue from the Term Pane menu.

    When there is no more data to display, the first item of the Term Pane menu changes to Disable Page Mode, which switches the display out of page mode.

    Use the Copy item to copy highlighted text from the Shell Tool window to the clipboard.

    When there is text on the clipboard, you can use the Paste item to insert the contents of the clipboard at the insert point.

    The Enable Scrolling item on the Term Pane menu can be used to turn the Shell Tool into a Command Tool. When you choose Enable Scrolling, the name stripe at the top of the Shell Tool still says "shelltool", but the application acts like a Command Tool. See the section, "Command Tool", for details.


The Console is a special Command Tool window that is used to display error and system messages for the SunOS operating system, the OpenWindows environment, and some applications. You can recognize a Console window by the term (CONSOLE) in the Command Tool header.

If you do not have a Console window, messages are displayed in large type at the bottom of the screen. To clear such messages, choose Refresh from the Workspace menu. Always have one (and only one) Console window running. If you have more than one Console window running, messages are displayed in the most recently opened Console window. You may miss important system messages if you have more than one Console window running and do not look for messages in the newest one, or if you have opened a new Console window and then quit the most recently opened one.