Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ CommandShell(1) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cmdo(1)

termcap(4)

brc(1M)

startmac(1M)

startmsg(1M)

StartMonitor(1M)

vt102(7)




CommandShell(1) CommandShell(1)
NAME CommandShell - manages command-interpretation windows and moderates access to the A/UX console window SYNOPSIS CommandShell [-b macsysinit-pid] [-q] [-u] ARGUMENTS -b macsysinit-pid Starts CommandShell in a background layer, without any windows, at system startup. With this option, CommandShell displays the A/UX console window but does not accept any other window-management commands. To display the console window, choose CommandShell from the Application menu (or Apple menu if it is not already open) and then choose A/UX System Console from the Window menu. No command-interpretation windows can be displayed. For further information on kernel errors or requests for input, see ``The A/UX Console Window'' in the ``Description'' section. Replace macsysinit-pid with the process ID of macsysinit (see brc(1M)) as an argument. After taking control of the system console, CommandShell sends this process a message telling it to exit. This message signals the continuation of all the remaining startup processes. Alert boxes are displayed as necessary to notify users of the need for input. -q Supresses the Quit menu item in the File menu; brings CommandShell into the foreground. -u Specifies that a user has logged in and started CommandShell in a background layer. When CommandShell is made the active application, the user's preferred (or the default) CommandShell window layout is established. The default task is to open a single CommandShell window. When you start CommandShell this way, you can choose Save Preferences from the File menu to save your preferences. DESCRIPTION CommandShell provides a Macintosh user interface to A/UX users. The available CommandShell menus are described in ``Menu Items'' later in the ``Description'' section. Within CommandShell windows, you can enter A/UX command lines for processing by one of the available shells. You can use the Macintosh copy and paste operations to enter A/UX commands in a CommandShell window. You can copy text from any previously entered command lines in the same window as well as any text available in other windows (including other Macintosh application windows). Because the CommandShell windows are scrollable, you can make previous January 1992 1



CommandShell(1) CommandShell(1)
commands or their output available for copying. You can also build an A/UX command line semiautomatically by using the Commando dialog boxes. Enter the command on the CommandShell command line; then choose Commando from CommandShell's Edit menu or press COMMAND-K. You can also use the cmdo command (see cmdo(1)). CommandShell Windows When you start CommandShell, one window is displayed by default unless you have saved a previous window layout that specifies more than one window. The default window is titled ``CommandShell 1.'' You can create more windows by choosing New from the File menu or by pressing COMMAND-N. Each time you perform one of these actions, a new window appears in front of the existing window or windows. The title bar of each new window is numbered in sequence according to the order of its creation. Normally you can create up to 15 windows. When you create a new window, it appears in front of, and slightly to the right of and below, the last current window. You can use the titling commands to view the contents of all the windows. For information on specific titling commands, see ``Window Menu'' later in the ``Description'' section. The A/UX Console Window Besides managing command-interpretation windows, CommandShell moderates access to the A/UX console window. This window is one of the places where the A/UX environment and the Macintosh desktop environment meet. Kernel error messages are routed to this window so as not to disturb the bitmapped display of Macintosh applications. The Macintosh user interface is an integral part of the A/UX boot process, supported in part by the A/UX console window of CommandShell. This special window is the place where all boot messages appear and where you enter responses in the event that one of the boot processes requires your input. System-startup messages. During the boot process, CommandShell disables many of the functions in its menus. The status messages that are normally directed to the system console during startup (many of which are useful only to the system administrator) are directed to the A/UX console window. To inspect the boot messages generated during the last system startup, choose A/UX System Console from the Window menu of CommandShell. 2 January 1992



CommandShell(1) CommandShell(1)
To view the A/UX console window, perform these steps: 1. If CommandShell is not active, choose it from the Application menu (or Apple menu if it is not open). 2. Choose A/UX System Console from the Window menu. 3. Use the scroll bar as needed to view the contents of the window. Notification of messages. Processes that run as part of a startup script, such as /etc/sysinitrc, or as another part of the booting process may occasionally require user input. For example, suppose you add an Ethernet card to your system. Then suppose that, while rebooting, the system needs to request address information about the new card. A/UX does not display a prompt asking for this information. Instead, an alert box, telling you that an A/UX process requires input, appears in front of the A/UX boot progress bar. Click OK in the alert box to cause the A/UX console window to appear and the alert box to disappear. The A/UX console window contains messages prompting you for input. You can now enter information in the window. At all other times, the window is for reading purposes only. This alerting process is called a ``notification system.'' A similar notification system has been created for the handling of A/UX kernel messages. The system displays alert boxes that encourage you to inspect the text of the A/UX error messages in the normally hidden A/UX console window. Here is what you should do in response to this form of notification: 1. After reading the alert box, click OK. 2. Make CommandShell the selected application if it is not already in control of the active window. 3. Choose A/UX System Console from the Window menu of CommandShell. The normally hidden A/UX console window is displayed; it contains all of the error messages generated since the system was last booted. If you scroll upward in the window, you can see the old messages. CommandShell also lets you respond to any prompts for input. If the error listed in the A/UX console window concerns system or network performance (such as a number of retries before successful transmission of a network packet), then no further corrective action is required. Sometimes, however, the error message may indicate a serious error condition, January 1992 3



CommandShell(1) CommandShell(1)
such as one of the following: file system full file system corrupt fork failed: too many processes In these cases, you may lose data if the error condition persists. Changing Notification Preferences. You can change the way the system notifies you that the A/UX console window has a message for you when CommandShell is not the active application. To set notification preferences, make CommandShell active and choose Notification Levels from the Preferences menu. In response, the system displays a dialog box in which you can select to be notified by an alert box, a blinking icon in the menu bar, or both. User preferences are normally stored in the .cmdshellprefs files located in your home directory. (See ``Managing CommandShell Preferences'' later in the ``Description'' section.) The default notification is an alert box because console messages may indicate a fundamental system problem that you should know about immediately. Leaving CommandShell It is not advisable to quit CommandShell because you will lose the ability to inspect the console window and enter responses to any prompts for information sent there. The next best thing to a Quit function is the option to choose Hide CommandShell Windows in the Applications menu. Terminal Attributes The hardware used as the means for accessing a UNIX system is often a keyboard and a character-oriented display. Such display devices are often called ttys or terminals. When you have a CommandShell window open, your terminal is used to emulate a conventional terminal device, including various display features and modes. For example, most terminal devices will respond to certain sequences of text as commands requesting the use of a special display mode, such as the display of underlined text. However, the command sequence required varies slightly from one terminal (or manufacturer) to another. For the default type of terminal that CommandShell emulates, VT102, additional command sequences exist to allow the selection of cursor type, tab stops, cursor position, line height, number of display lines, number of display columns, and so on. See vt102(7) for a summary of this information. (You could also look at one of the commercial books that 4 January 1992



CommandShell(1) CommandShell(1)
more fully describe the escape and control sequences for VT102-style terminals.) Furthermore, the particular VT102 emulation that CommandShell provides offers support beyond the standard control and escape sequences to permit you to control CommandShell windows, such as resizing or retitling them based upon a control sequence. For these special features that exceed VT102 specifications, see ``Window Control Sequences'' later in the ``Description'' section. Note that only an A/UX process (usually a shell) running in the active window (the window with horizontal lines in the title bar) receives key sequences generated through the keyboard inputs. Other CommandShell windows must first be activated before keyboard input can be read by them. To allow you to run a UNIX program that expects to send command sequences for a particular type of terminal device, CommandShell can be set to emulate such third-party devices in open CommandShell windows. To help identify the terminal type, conventional UNIX systems require you to place special values inside the TERM shell variable (see termcap(4) and terminfo(4)). With A/UX, you need to inform CommandShell and the shell of the desired setting by setting the TERM variable. The interface supported by character-display terminals may seem, at first impression, to be inferior to a graphic display simply because it is old-fashioned. However, consider the ways in which you can perform file- manipulation operations such as ``delete file.'' The desktop metaphor helps depict the action of file deletion graphically because you drag the file icon to the Trash icon. Using the old-fashioned approach, you open a CommandShell window to run the command rm. The old- fashioned way is harder to learn and less intuitive in the simple case. However, the graphic interface can be tedious and laborious when you need to perform a more sophisticated deletion. Consider the task of removing from the current directory only those files named a particular way. For example, say that you want to delete files only if their names end with ``.tmp.'' In this case, the easier way to delete them is to use a command line, such as this one: rm *.tmp Menu Items CommandShell displays menus titled File, Edit, Window, Fonts, Commands, Keys, and Preferences in the menu bar at January 1992 5



CommandShell(1) CommandShell(1)
the top of the screen, plus the Apple menu at the left end of the menu bar. To choose a menu item, position the pointer on the menu title, press and hold down the mouse button, and move the pointer to the menu. Release the mouse button when the pointer highlights the desired item. You can choose many menu items from the keyboard by holding down the COMMAND key (not the CONTROL key) and typing a character. This COMMAND-key equivalent is shown beside the menu item. You can enter the COMMAND-key equivalents as lowercase letters; you don't need to hold down SHIFT as well. The sections that follow describe the actions performed by the CommandShell menu items. Apple Menu. At the left end of the menu bar, the Apple symbol is the title of a menu that contains some general Macintosh desk accessories and some menu items specifically related to CommandShell. These menu items are related to CommandShell: About CommandShell Displays a dialog box that gives version information. CommandShell Makes CommandShell the active application and makes the CommandShell window that was most recently active the active window once again. File Menu. The menu items in the File menu allow you to create and close windows, to select printing options, and so on. The File menu contains the following items: New Creates a new window. The windows are numbered sequentially according to the order of their creation. The COMMAND-key equivalent for the New menu item is COMMAND-N. Open Launches a UNIX command or launches an editor if the highlighted file is a text file. The COMMAND-key equivalent for the Open menu item is COMMAND-O. Close Closes the active window. Before you close a window, make sure that you write the contents of the window to a disk if you want to save your work. The COMMAND-key equivalent for the Close menu item is COMMAND-W. 6 January 1992



CommandShell(1) CommandShell(1)
Save Selection Saves the contents of a CommandShell window in an A/UX file. The text you want to save must be selected (highlighted). Page Setup Displays a dialog box that lets you set the paper size, orientation, and reduction or enlargement for subsequent printing opertions. Print Selection Prints selected text from the active window. Use the Chooser desk accessory, available in the Apple menu, to specify which printer to use. Use the Page Setup menu item just described to specify paper size, orientation, and scale. Close All Windows Closes all open windows at once. Before you close the windows, make sure that you write the contents of each window to a disk if you want to save your work. If you don't write the contents to a disk, they are lost. Quit Quits CommandShell, closing any windows that are open. Edit Menu. The menu items in the Edit menu let you move text around and perform certain global formatting actions. The Edit menu contains these items: Undo Reverses the most recent text change. If you choose Undo a second time, the change is reinstated. The COMMAND-key equivalent for the Undo menu item is COMMAND-Z. Cut Copies the currently selected text in the active window to the Clipboard and then deletes it from the window. This menu item is used with desk accessories only; unless a desk accessory is active, it is disabled. The COMMAND-key equivalent for the Cut menu item is COMMAND-X. Copy Copies the currently selected text in the active window to the Clipboard without deleting it from the window. The COMMAND-key equivalent for the Copy menu item is COMMAND-C. Paste Inserts the contents of the Clipboard at the current cursor location. The COMMAND-key equivalent for the Paste menu item is COMMAND-V. January 1992 7



CommandShell(1) CommandShell(1)
Clear Deletes the currently selected text from the active window. This menu item is used with desk accessories only; unless a desk accessory is active, it is disabled. The keyboard equivalent for the Clear menu item is DELETE. Select All Selects the entire document shown in the active window. The COMMAND-key equivalent for the Select All menu item is COMMAND-A. Commando Builds commands semiautomatically. Choose this menu item after entering the command name at the beginning of a line. A dialog box appears, depicting all the features of the command so that you can select the ones you want to use. When you close the dialog box, the command line that you started to specify before choosing Commando is changed to include all of the command options and arguments that you generated with the help of the Commando dialog box. The COMMAND-key equivalent for the Commando menu item is COMMAND-K. Window Menu. The menu items in the Window menu help you arrange and display CommandShell windows. The menu is divided into three parts. The upper part of the menu contains menu items that help you arrange windows in various formats. The middle part contains menu items that help you size and order the windows. The lower part contains a list of all windows currently available in CommandShell. When you choose one of the window names in the lower part of the menu, CommandShell makes the corresponding window active. The names of currently available windows are listed in the order in which they were opened. The menu items in the top part of the menu do the following tasks: Tile Positions windows in a right-to-left, then top-to- bottom sequence. You must have more than one window open on the desktop to use this menu option. The COMMAND-key equivalent for the Tile menu item is COMMAND-T. Tile Horizontal Positions windows from top to bottom on the screen in the order in which they were opened. The windows are enlarged to the width of the screen. The height of each window is adjusted to accommodate the number of windows. 8 January 1992



CommandShell(1) CommandShell(1)
Tile Vertical Positions windows from left to right on the screen in the order in which they were opened. The windows are enlarged to the height of the screen. The width of each window is adjusted to accommodate the number of windows. Standard Positions Repositions the windows in the original stacked order, from front to back. The items in the middle part of the menu do the following tasks: Standard Size Resizes a window to its original dimensions. The COMMAND-key equivalent for the Standard Size menu item is COMMAND-S. Full Height Enlarges a window to the full height of the screen. The COMMAND-key equivalent for the Full Height menu item is COMMAND-F. Zoom Window Enlarges the window to the full height and width of the screen. You can return a window to its previous size by choosing the Zoom Window menu item again. The COMMAND-key equivalent for the Zoom Window menu item is COMMAND-backslash. Hide window-name Makes the specified window (window-name) temporarily disappear. The window is no longer visible, but it is still available. To display a window that has been hidden, choose this command from the Window menu again. The window reappears, as the active window. The COMMAND-key equivalent for the Hide window-name menu item is COMMAND-H. Show All Windows Displays all windows that have been hidden. Last Window Makes the previously active window the active window once again, making it visible if it was hidden. Choosing the command again returns the windows to their original states. The COMMAND-key equivalent for the Last Window menu item is COMMAND-L. Rotate Window Matches the window that is at the back of the window January 1992 9



CommandShell(1) CommandShell(1)
stack to the active window. The COMMAND-key equivalent for the Rotate Window menu item is COMMAND-R. The menu items in the lower part of this menu are the names of all currently available CommandShell windows. When you choose a name, the corresponding window becomes active and moves to the front. The A/UX console window is always included in this list. A/UX System Console Makes the A/UX console window the active window. This window displays console messages. The COMMAND-key equivalent for the A/UX System Console menu item is COMMAND-0 (zero). Fonts Menu. The Fonts menu lets you choose the font and the point size of text entered or displayed in the active CommandShell window. The last item in the Fonts menu, Other, displays a dialog box that allows you to enter the exact point size you desire. Commands Menu. You use the menu items in the Commands menu to choose default settings for recording information and to clean up the screen. Don't Record Lines Off Top/Record Lines Off Top Toggles between recording a preset number of lines that have scrolled off of the screen or deleting these lines. When you start CommandShell, it is set to record a preset number of lines as they scroll out of view. If you do not want to store the lines for possible review later, you can stop the recording of lines for the active CommandShell window by choosing Don't Record Lines Off Top. To begin recording lines again, choose Record Lines Off Top. The lines are again recorded as they scroll out of view at the top of the window. Clear Lines Off Top Erases recorded lines and makes them no longer available for review within the active window. The scroll bar disappears from the active CommandShell window. Redraw Screen Cleans up the screen if text output affects the bitmapped display. Preferences Menu. You use the menu items in the Preferences menu to specify how you want to be notified of system 10 January 1992



CommandShell(1) CommandShell(1)
messages, to choose your default window settings, and to set your preferred window configuration. For more complete descriptions of the dialog boxes that are associated with these menu items, refer to the CommandShell chapter in A/UX Essentials about CommandShell. Notification Levels Sets the notification level for console messages. A dialog box appears in which you specify how you want to be notified of console messages. The choices are an alert box, a blinking icon in the menu bar, or both. New Window Settings... Specifies the default title prefix, point of origin of the window cascade, window size, font name, font size, and number of lines saved off the top of the window. A dialog box appears in which you set these specifications. The Set Emulation button leads to a set of control-panel dialog boxes for setting terminal emulation parameters. Active Window Settings... Specifies the settings for the active window. A dialog box appears allowing you to specify the title, size, and position of the window; a setting that determines whether to record lines that scroll out of view; and an initial command to run in the window when it opens. The Set Emulation button leads to a set of control- panel dialog boxes for setting terminal emulation parameters. Save Preferences Saves all window settings, layout information, and notification-level settings. Restore From Preferences Restores window settings and layout to the ones specified in the preferences file. This command also activates any saved windows that have been closed and runs an initial command in windows that do not already have a command running. Keys Menu. This menu contains two items that display submenus that are not formed of the usual list of commands, but rather are graphic palettes that represent key buttons. Key pad Displays a keypad of numeric keys, in which clicking a ``key'' is equivalent to pressing the corresponding number key on the numeric keypad of a keyboard. The corresponding value is entered on the command line at the current cursor position. January 1992 11



CommandShell(1) CommandShell(1)
Cursor Keys Displays a keypad of the arrow keys, in which clicking a ``key'' is the equivalent of pressing the corresponding arrow key on a keyboard. Each selection from this palette alters the position of the cursor in the currently active CommandShell window. Managing CommandShell Preferences Preferences are normally saved in the .cmdshellprefs file located in the home directory. To maintain more than one set of preferences, you can establish a different filename for the file in which preferences are stored. For example, to save one set of preferences (window sizes and so forth) for use with a large display device and another set of preferences for use with a smaller display device, you can reset the CommandShell variable that controls the file in which these settings are maintained. The name of this variable is CMDSHELLPREFS. You can set this variable to something other than .cmdshellprefs. When you reset the variable, you should assign it a filename relative to your home directory. Window Control Sequences When the emulation mode has been set to VT102, you can provide additional control sequences besides those that are standard features of VT102 devices. These additional sequences allow you to control CommandShell windows through a means other than its interactive menus and dialog boxes. Here is a list of these control sequence formats. \E is used to represent the ASCII code (27) for the ESC key. \E[1t Makes the window associated with the process that sends this sequence the active window (displaying it if it was hidden). \E[4;height;widtht Resizes the window associated with the process that sends this sequence in terms of the pixel amounts given in place of height and width. \E[5t Moves the window associated with the process that sends this sequence to the front, without affecting the status of CommandShell as the selected application. \E[6t Moves the window associated with the process that sends this sequence to the back of any other CommandShell windows, without affecting the status of CommandShell 12 January 1992



CommandShell(1) CommandShell(1)
as the selected application. \E[6t Refreshes the window associated with the process that sends this sequence, without affecting the status of CommandShell as the selected application. \E]ltitle\E\ \E]Ltitle\E\ Retitles the window associated with the process that sends this sequence, causing it to be named title. Some control sequences you can send are not used to directly control a CommandShell window, but instead request information about the window. Here is a list of these sequence formats for querying windows. ( \E is used to represent the ASCII code (27) for the ESC key. \E11t Causes CommandShell to generate a text string on the standard input of the process that sent the string. The generated string indicates whether the window originally associated with a process is still open. The sequences that CommandShell can generate in response are as follows: \E[1t The CommandShell window is still open. \E[2t The CommandShell window is closed. \E13t Causes CommandShell to generate a text string on the standard input of the process that sent the string. The generated string indicates the current location of the window originally associated with the process, in the following format: \E[3;topmost-pixel;leftmost-pixelt \E14t Causes CommandShell to generate a text string on the standard input of the process that sent the string. The generated string indicates the current size of the window originally associated with the process, in the following format: \E[4;height-in-pixels;width-in-pixelst \E18t January 1992 13



CommandShell(1) CommandShell(1)
Causes CommandShell to generate a text string on the standard input of the process that sent the string. The generated string indicates the current size of the window originally associated with the process, in the following format: \E[8;character-rows;character-columnst \E21t Causes CommandShell to generate a text string on the standard input of the process that sent the string. The generated string indicates the current title of the window originally associated with the process, in the following format: \E[ltitle\ FILES /mac/bin/CommandShell Executable file /mac/bin/%CommandShell Resource fork file $HOME/.cmdshellprefs Default preferences file $HOME/System Folder/Extensions/VT102 Link file /mac/lib/SystemFiles/shared/Extensions/VT102 Communications Toolbox binary file /mac/sys/System Folder/Extensions/VT102 Link file SEE ALSO cmdo(1) termcap(4) in A/UX Programmer's Reference brc(1M), startmac(1M), startmsg(1M), StartMonitor(1M) in A/UX System Administrator's Reference vt102(7) in A/UX Programmer's Reference A/UX Essentials 14 January 1992

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