# doc/vsh.txt - A Visual Command Processor for the UNIX Operating System # David Scheibelhut, Feb 83 # http://kinzler.com/me/home.html#other A Visual Command Processor for the UNIX Operating System David M. Scheibelhut1 Computer Science Division Electrical Engineering and Computer Sciences Department University of California Berkeley, California and Bell Laboratories Naperville, Illinois 60540 ABSTRACT Vsh is a visual interactive command processor or shell for the UNIX* [1] operating system. Vsh is an attempt to provide a command processor for high-bandwidth video terminals. This orientation results in the printing of much more information than provided by traditional command processors. This orientation also results in closer control over what is printed so nothing unintentionally scrolls off the top of the screen. The following set of papers describe Vsh. The first, "A Visual Command Processor for the UNIX Operating System," describes the goals of Vsh and how successfully they have been met. The second, "Vsh Code Organi- zation," describes the implementation. The third is a user's manual. Finally, the appendix con- tains copies of the help files available to the online user. Introduction. A program tends to complement its input/output devices. For example, batch programs interface to high speed printers. A batch program's output tends to be lengthy and detailed, since the printing costs little and extra detail may obviate the need for extra runs. __________________________ *UNIX is a Trademark of Bell Laboratories. 1. Work reported herein was supported in part by the U. S. Department of Energy, Contract DE-AT03-76SF00034, Project Agreement DE-AS03-79ER10358, and the National Science Foundation under Grant No. MCS 7807291. February 9, 1983 - 2 - Existing UNIX programs have the opposite tendency since they were usu- ally built for slow, hardcopy terminals. Because printing takes so much time, messages tend to be terse, and information is printed only when specifically requested. High-bandwidth video terminals benefit from a different orientation: One does not worry excessively about the time it takes to print messages. Instead, one is concerned about los- ing information off the top of the screen before it is used. Operation. Vsh is an attempt to apply this alternative strategy to a command processor. Vsh is highly visual. It automatically prints a consider- able amount of information, and makes sure that information does not scroll off the top of the screen. Vsh is organized around the UNIX file system. This file system has a hierarchical structure which can be represented as a tree. Each node in the tree is a directory and each leaf a file. Each node and leaf has a name. To reference a file one specifies the string of names which traverses the file system from the root to the desired file. One may also reference files relative to one's working direc- tory. This directory may be set to any accessible directory in the file system. Vsh operates by automatically displaying the members of the work- ing directory. Each member is labeled with a lower case letter in the fashion of an indexed menu. To select a member one presses its corresponding letter. After selection, Vsh determines the nature of the file and takes appropriate action. If the member contains ASCII February 9, 1983 - 3 - text, Vsh calls on the editor. If the member is a directory, Vsh makes it the working directory and displays its files. Vsh recognizes many other types of files as described in the user's manual. Directories with a large number of members cannot be displayed in a single screen. Such directories are broken down into single-screen pages. These pages are selected by typing in their corresponding number. To select a file in such a directory, one first selects the page, then the file. One can do more than select files and directories. By pressing upper-case letters and special characters one can select commands. There is a set of basic commands which allow one to create and delete files, invoke compilers, and perform other basic functions. One may also define new commands in terms of the basic commands and in terms of other programs, and in this way create a personalized environment. Although the Vsh program is not particularly large, it has a large number of features. The difficult part in implementing Vsh was connecting these parts together so they would coexist in a harmonious fashion. I believe the parts do fit together in a clean manner. The companion document to this paper, "Vsh Code Organization," covers the details of how Vsh really works. Visual Techniques. The hallmark of visual software is careful control of output. Relevant information appears on the screen when needed, and does not scroll off the top before use. Because one can only put so much information on a screen, it is possible to jump between displays in an February 9, 1983 - 4 - easy, natural manner. I believe Vsh does satisfy these criterion. The ease of jumping between displays was an important considera- tion during the design of Vsh. This emphasis makes Vsh an ideal tool for browsing through the UNIX file system, for one can move easily between the various directories and files. This convenience also extends to the operation of compilers. When one compiles a program, the compiler error messages are collected in a file and displayed. One then selects an error message from the display, and Vsh determines the line and file the message references. An editor is then called, editing the file starting at the offending line. When the error is fixed, one can return to the error display to select another. This is a large improvement compared to just dumping the error messages on the terminal, because the risk of losing the errors off the top of the screen before use is eliminated. A visual editor called Vi [2] has been well received in Berkeley where one finds little use of the standard editor. Vi is similar to Vsh; it automatically displays information (the file being edited) and is based on short, often single keypress, commands. A command proces- sor, however, is not an editor. One does not find the dramatic improvement of Vi over the standard editor when one uses Vsh. Part of the problem is that Vsh does not have the full power and flexibility of the standard UNIX command processor. It seems clear that the use of single-keypress commands was just too restricting. A richer com- mand language is necessary. Historically, Vsh was not the first visual command processor, but was inspired by The University of Illinois PLATO [3] system. With February 9, 1983 - 5 - PLATO, everything is visual. This orientation is in part a result of PLATO's computer assisted instruction emphasis, and in part a reflec- tion on the nature of the PLATO terminal which cannot scroll. My goal was to merge the best features of PLATO and UNIX philosophies. A result of this synthesis is Vsh. A major problem with PLATO is that there is no alternative to the visual, interactive way of doing things. If one wants to edit a block, one cannot specify the block by name. One must select it from the display. The Vsh F command allows one to select a file by name, easing the problem somewhat. A major difficulty remains; one cannot easily consider writing a script of commands for Vsh. Such a script with its single-keypress commands would be unreadable. Clearly, one needs a traditional command processor for many applications. The issue is whether it is worthwhile to learn both modes of interaction. At Berkeley, people are willing to use both types of editors. Perhaps people will embrace two shells. Further Work. It would be interesting to see Vsh go beyond its current restric- tive status and implement a universally applicable visual shell. This shell would be the focus of a visually oriented programming system as available in Xerox's Interlisp [4] system. One can imagine countless features. One would be able to split the screen into sub-displays and run a separate process in each display. One would be able to recall previous displays. These features could support utilities such as split-screen editors. Communications between users would be facili- tated. Messages from other users would appear in a special display, February 9, 1983 - 6 - rather than just showing up at the bottom of the screen. One could allow others to monitor one's own displays. Many questions need to be addressed in such a system, including the appearance of the user and operating system interfaces, and the appearance of the terminal. The use of multiple screens, cursors, touch panels, special keysets, and intelligent terminals are areas which ought to be addressed. What ever its drawbacks, Vsh is a step in this direction. Conclusion. The major flaw of Vsh is that it cannot act as a complete command processor, although I believe such a command processor can be built as part of a visually oriented programming system. Building such a sys- tem would be a major endeavor. For the time being, Vi and Vsh can provide the flavor of such a system and inspire people to build it. February 9, 1983