[net.sources] VSH sources 5 of 6

dan@rna.UUCP (Dan Ts'o) (06/29/85)

# Here is part 5 of the sources to VSH, a visual shell.
#
#
#					Cheers,
#					Dan Ts'o
#					Dept. Neurobiology
#					Rockefeller Univ.
#					1230 York Ave.
#					NY, NY 10021
#					212-570-7671
#					...cmcl2!rna!dan
echo doc/README
sed 's/^X//' > doc/README << 'All work and no play makes Jack a dull boy'
X	The files genhelp, genhelp.dan, rmhelp, showhelp, vsh.doc all
Xbelong in /usr/lib/vsh.
X
X	vshelp is a sample help menu for novices. Set helpfile to vshelp
Xbefore entering VSH (in .vshrc) to use a help menu. It is not very compatible
Xwith multi column directory displays.
X
X	vshrc is a sample initialization file which is similar to the way
XI like to use VSH. Its companion helpfile is genhelp.dan .
All work and no play makes Jack a dull boy
echo doc/genhelp
sed 's/^X//' > doc/genhelp << 'All work and no play makes Jack a dull boy'
X			  Command Summary
XCommand		Action
X
X^D		Leave Vsh, must be entered twice
X1-9		Select page 1-9
X0		Select page 10
X+, ^F		Select next page, + next column
X-, ^U		Select previous page, - previous column
X^L		Re-display same page
X.		Select page with files beginning with character prompted for
Xa-t		Select associated file
X^ (HOME)	Change to Home directory
X/		Change to root
X\		Change to previous directory (undo last change directory)
X?		Display this page
X!		Execute shell
X%		Chain to shell (does not return to Vsh)
X$		Execute Bourne shell
Xline feed	Change to parent directory.
X
X
XCommand		Action
X
XC		Create file or directory
XD		Date
XE		Show Errors from previous make
XF		File selection by name
XG		Grep
XL		Long listing of files on current page
XM		Make
XN		Make forked off (2 bells on OK return, 3 bells on error)
XO		Options
XP		Ps (Print processes)
XR		Remove files
XS		Show output of Grep
XT		Type out (display) text file
XW		Who
XX		eXecute any shell command
XY		Re-execute previous X shell command
X
XThese commands are useful in select mode.
XCommand		Action
X<TAB>		Forward column
X^F		Forward column (Emacs style)
X^B		Backward column
X^P		uP column
X^N		dowN column
X^A		Back series
X^E		Forward series
Xh,j,k,l		Forward, backward, up, and down (VI style)
X'		Enter selected item
X
XThese commands are available when viewing files or output through VSH's pager,
X(More? prompt with the VSH display command, help or pexec)
X1,<		First line
XG,>		Last line
X?,^R		Reverse search
X/,^S		Forward search (wraps around)
Xe,v		Invoke $EDITOR
X-,^P,k		Previous line
X<CR>,^N,j	Next line
X^U		Previous half page
X^D		Next half page
X^B,^		Previous full page
X^L		Re-paint page
X!		Fork a subshell
X(anything else)	Next full page
X
XMost of the above commands, especially A-Z, are user-alterable.
XSee "help vsh" for more information.
All work and no play makes Jack a dull boy
echo doc/genhelp.dan
sed 's/^X//' > doc/genhelp.dan << 'All work and no play makes Jack a dull boy'
X			  Command Summary
XCommand		Action
X
X<ESCAPE>	Leave Vsh, must be entered twice
X1-9		Select page 1-9
X0		Select page 10
X+, ^D, ^F, <SP>	Select next page, + next column
X-, ^U		Select previous page, - previous column
X^L		Re-display same page
X.		Select page with files beginning with letter prompted for (find)
Xa-t		Select a file
X^		Change to Home directory
X/		Enter file prompted for (display, chdir, etc.)
X\		Change to previous directory (undo last change directory)
X?		Display this page
X!		Execute shell
X%		Chain to shell (does not return to Vsh)
X$		Execute Bourne shell
Xline feed	Change to parent directory
X;		Execute any shell command
X
X
XCommand		Action
X
XA		Adb (invoke debugger) on selected file
XB		Od (octal dump) of selected file
XC		Create file or directory
XD		Date
XE		Show Errors from previous make
XF		Df, display status of filesystems
XG		Grep
XH		Home, chdir $HOME
XI		Tar tvf of selected file (list directory of a tar archive)
XJ		Nroff -ms selected file
XK		Notes -i *.* (read new notes/news)
XL		Long listing of files on current page
XM		Make
XN		Make forked off (2 bells on OK return, 3 bells on error)
XO		Options
XP		Ps (Print process statuses)
XQ		Du of selected file/directory (total disk usage)
XR		Remove files
XS		Show output of Grep
XT		Tail of selected file
XU		Su, invoke a superuser shell
XV		chain to vsh, overlay current VSH
XW		Who
XX		eXecute select file
XY		Re-execute previous ';' shell command
X
Xu		Uucp status
Xv		invoke VI editor on selected file
Xw		read mail
Xx		Size of selected file (print size of executable programs)
Xy		File on selected file (print a guess of a file's contents)
Xz		invoke EMACS editor on selected file
X
X(		Pack a selected file (compress a file)
X)		Unpack a selected file (uncompress a file)
X@		Rm -r a select file/directory (be careful)
X#		invoke a root-privileged VSH
X=		Ls a selected file/directory
X,		run a shell command through VSH's pager
X:		change the mode of a selected file
X
XThese commands are useful in select mode.
XCommand		Action
X<TAB>		Forward column
X^F		Forward column (Emacs style)
X^B		Backward column
X^P		uP column
X^N		dowN column
X^A		Back series
X^E		Forward series
Xh,j,k,l		Forward, backward, up, and down (VI style)
X'		Enter selected item
X
XThese commands are available when viewing files or output through VSH's pager,
X(More? prompt with the VSH display command, help or pexec)
X1,<		First line
XG,>		Last line
X?,^R		Reverse search
X/,^S		Forward search (wraps around)
Xe,v		Invoke $EDITOR
X-,^P,k		Previous line
X<CR>,^N,j	Next line
X^U		Previous half page
X^D		Next half page
X^B,^		Previous full page
X^L		Re-paint page
X!		Fork a subshell
X(anything else)	Next full page
X
XMost of the above commands, especially A-Z, are user-alterable.
XSee "help vsh" for more information.
All work and no play makes Jack a dull boy
echo doc/rmhelp
sed 's/^X//' > doc/rmhelp << 'All work and no play makes Jack a dull boy'
XTo select a file for removal, press its corresponding letter (a-t).
XSelecting a file a second time "undeletes" the file.
X
XOne can select all files on a page by pressing -*-.
X
XA file selected for removal is marked with a "//".
X
X
XOne can move through the various pages with the usual commands
X(0123456789+-.^F^L^U)
X
XTo exit without removing any files, press -Return-.
XTo exit and cause permanent removal of selected files, press -R-.
X
All work and no play makes Jack a dull boy
echo doc/showhelp
sed 's/^X//' > doc/showhelp << 'All work and no play makes Jack a dull boy'
X		* * S h o w f i l e    H e l p * *
X
XThese are the showfile commands.  It is not necessary to press -Return-
Xafter these commands.  When a complete command is sensed, it is run
Ximmediately.
X
XCommand		Description
X
X^D, q		Leave Showfile.
Xor quitchar
X
X?		Print this page.
X
Xnumber p	Print file starting at specified line.
X
Xnumber e	Examine line for a file name and line number.
X		if a file name is found, run the editor on this file.
X
X-Return-	Print next twelve lines in the file.
X
Xnumber -Return-	
X		Same is "number e."
X
X^H, <DEL>	Delete last digit of number
X
XIn addition to the previous commands, most of the commands from the
Xdirectory page are available in showfile.  They include ^, /, !, %,
Xand A-Z except L and R.  Particularly useful are M and G which allow
Xnew iterations of Make and Grep, !, the escape to the shell, and F,
Xwhich allows one to edit any file.
X
XDirectory motion commands such as '+' exit showfile mode and perform
Xthe expected directory page motions.
X
XTo return to showfile display from Vsh, use 'E' to review the
Xlast .makerror file and 'S' to show the last .grepout file.
X
XVsh always searches for .makerror in the current directory.  Vsh
Xsearches for .grepout first the current directory, then in your
Xhome directory.
X
XWhen a line is selected with the e command, Vsh tries to extract
Xa file name and line number from the line.  As the output
Xfrom grep is of constant format, a selection will never fail with grep.
XVsh tries its best with the output of compilers and lint.
All work and no play makes Jack a dull boy
echo doc/vsh.doc
sed 's/^X//' > doc/vsh.doc << 'All work and no play makes Jack a dull boy'
X	Vsh is a screen-oriented shell designed to replace the standard shell
Xin many of the simpler operations involved in program and text development.
XIn addition to the commands below, vsh is extensible via the 'O' command.
XA user can define his own commands with either the 'O' command or in a file
X.vshrc in his login directory, which will be loaded upon vsh startup. The upper
Xcase letters, lower case u-z, and most printable special characters can be
Xredefined.  More can be redefined in multicolumn mode. See the vsh.intro
Xdocumentation for more information.
X
X			VSH Command Summary
X
XCommand		Action
X
X^D		Leave Vsh, must be entered twice, see parameter quitchar
X1-9		Select page 1-9 (listing of files in current directory)
X0		Select page 10
X+, ^F, ^D	Select next page, + next column
X-, ^U		Select previous page, - previous column
X^L		Re-display same page
X.		Select page with files beginning with character prompted for
X		(Files listed with a following * are executable)
X
Xa-z		Select associated file
X^ (HOME)	Change to Home directory
X/		Change to root
X\		Change to previous directory
X?		Display this page
X!		Execute shell
X%		Chain to shell (does not return to Vsh)
X$		Execute Bourne (Version 7) shell
Xline feed	Change to parent directory.
X
XC		Create file or directory
XD		Date
XE		Show Errors from previous make
XF		File selection by name
XG		Grep
XL		Long listing of files on current page
XM		Make
XN		Make forked off (2 bells on OK return, 3 bells on error)
XO		Options
XP		Ps (Print processes)
XR		Remove files
XS		Show output of Grep
XT		Type out (display) text file
XW		Who
XX               eXecute any shell command
XY		Re-execute previous X shell command
X
XMost of the above commands, especially A-Z, are user-alterable.
XThese commands are useful in select mode.
XCommand		Action
X<TAB>		Forward column
X^F		Forward column (Emacs style)
X^B		Backward column
X^P		uP column
X^N		dowN column
X^A		Back series
X^E		Forward series
Xh,j,k,l		Forward, backward, up, and down (VI style)
X'		Enter selected item
X
XThese commands are available when view files or output through VSH's pager,
X(More ? prompt with the VSH display command, help or pexec), see also the
Xdescription of the parameter moresize.
X1,<		First line
XG,>		Last line
X?,^R		Reverse search
X/,^S		Forward search (wraps around)
Xe,v		Invoke $EDITOR
X-,^P,k		Previous line
X<CR>,^N,j	Next line
X^U		Previous half page
X^D		Next half page
X^B,^		Previous full page
X^L		Repaint screen
X!		Fork a subshell
X(anything else)	Next full page
X
X	The forward and reverse searches search for a prompted string pattern
Xwhich supports only the ^ . $ regular expression extensions. Note that a forward
Xsearch can cause a file to be read til EOF and then either wraparound or
Xrestoring the display after an unsuccessful search can fail if the size of the
Xmore buffer is insufficient to hold the entire file. Reverse searches do not
Xwraparound beyond the beginning of the file (or as much as can be buffered).
X	One can also set several parameters used by vsh using the O command,
Xsuch as the editor, the shell, and the make commands called.
X	These commands are the recognized keywords which a character command
Xcan be set to:
X	
X	chain		Chain (exec without fork) to a shell command
X*	create		Create a new filename
X	date		Display the date and time
X*	display		Display the contents of a text file
X*	exec		Execute a shell command (does not uses the shell)
X	file		Enter a file, see below and parameter enterpath
X	fmake		Execute make, do not wait for completion
X*	grep		Search for a string pattern in a set of files
X	home		Change to home directory
X	longlist	Extend file listing to include size, modtime, etc.
X	null		No operation, clear the command character
X	options		Set options, commands and parameters
X*	pexec		Execute like exec (above) but page output
X	remove		Remove files
X*	rexecute	Re-execute previous xecute command
X	shell		Create a subshell
X	showerror	Display the make error file
X	showgrep	Display the grep log file
X	wmake		Execute make, wait for completion
X*	xecute		Execute one shell command, prompt if no command
X
X	The commands above which are denoted by an asterisk '*', are interfaced
Xto the select mode of vsh, as described below. Certain commands such as 'file'
Xand 'display' prompt for a filename if none has been selected. Entering a lone
X'!' causes the previous filename to be used.
X	If the command string to either the exec or xecute commands begins
Xwith a semicolon ';', the screen is immediately updated after the command
Xcompletes.
X	A filename beginning with tilde '~', is interpreted as a login
Xdirectory belonging to the following username (e.g. ~username = /usr/username).
XThe filenames '~' and '~/' refer to the HOME directory.
X	If the options command is invoked with a file argument, a
X.vshrc-compatible copy of the current set of options and command definitions is
Xplaced in the named file.
X
X	A file is "entered" by either the selection process, or the VSH file
Xcommand. The VSH pager (see below) may be invoked as part of the entering
Xprocess. These actions occur to the selected file depending on the file type:
X
XFiletype	Action
Xdirectory	Change to directory, make named directory the working directory
Xarchive		ar tv, produce listing of contents of archive through pager
Xcpio		cpio -itv, produce listing of contents of archive
Xcore dump	adb debugger
Xa.out format	nm, produce listing of name list through pager
Xpacked file	pcat or ccat, decoding file through pager
Xdevice		Cannot be entered
Xanything else	A quick test is performed to guess whether file is ASCII text.
X		If the file seems to be ASCII text, either the pager or the
X		editor or some other program is invoked with the file, depending
X		on whether the VSH parameter entertext is set to display,
X		$EDITOR, or an arbitrary program.
X
X	VSH parameters can be changed by altering one's .vshrc file and starting
Xup VSH, or by using the VSH options command, which affects the current instance
Xof VSH only. These are parameters used by vsh:
X
XNAME		DEFAULT
X
XEDITOR		vi
XHOME
XTERM		unknown
XPATH		:/bin:/usr/bin
XSHELL		/bin/sh
Xgrep		/bin/grep
Xgrepout		.grepout		Grep output file
Xmake		/bin/make
Xmakerror	.makerror		Make output file
Xquitchar	D			Quit command (octal 0100 is
X					 subtracted, thus D is
X					 control D and [ is <ESC>)
Xpagechar	{			Page command synonym for '+',
X					 like 'quitchar', 0100 is
X					 subtracted, '{' is ';', and
X					 'M' would be <return>
Xrmhelp		/usr/lib/vsh/rmhelp	Remove help file
Xshowhelp	/usr/lib/vsh/showhelp	Show(grep,make) help file
Xvshmode		enter			Vsh operating mode
Xentertext	$EDITOR			Determines how to enter a text
X					 file.
Xhelpfile	$HOME/.vshelp		Help file always displayed
Xwindow		full screen		Lines for VSH
Xcolumn		1			Number of filename columns
Xnoargprompt				Prompt for missing arguments
XVImotion				Use hjkl for page motions
XMAIL		/usr/spool/mail/~	Check for new mail
Xmoresize	10000			Memory buffer size for reversing
X					the VSH pager used with
X					(display, help, pexec)
Xenterpath	:			List of directories to search
X					when entering a file via the
X					keyboard VSH file command.
X
X	The parameter vshmode, sets one of two operating modes. The first
X(default) mode, enter, accepts single character commands as described above.
XThe second mode, select, is obtained by setting the parameter vshmode to
X"select". In select mode, a character a-z is used to select a filename to
Xbe used for the next command. A second character determines the command
Xto be executed. If the command character entered is again a-z refering to the
Xsame filename, that filename is entered as in the enter mode. If another a-z
Xfilename is selected, that filename becomes the selected filename and vsh
Xawaits for another command character. If the command character is an action
Xcommand, that action is performed, using the selected file where relevant
X(e.g. G, T). Thus typing 'aa' in select mode is equivalent to typing 'a'
Xin enter mode. The selected file can also be entered by the ' command.
X	The parameter entertext determines how vsh enters text. The default
Xvalue $EDITOR causes vsh to enter text by calling the text editor refered to
Xby the vsh EDITOR parameter. If the entertext value is "display", the vsh
Xinternal pager, display, is used to enter text (displaying its contents).
XAny other value for entertext causes vsh to invoke that string as a simple
Xshell command with the selected file as its argument. If the command is
Xprefixed with a semicolon ';', the screen is immediately updated after the
Xcommand completes.
X	In select mode, one can define new commands which will use the
Xselected filename as an argument. Specifically the keywords "exec", "pexec",
Xand "xecute" (normally associated with the X and Y commands) both accept the
Xselected filename as an argument. Every occurance of a lone dollar sign ($)
Xseparated by spaces is replaced by the selected filename. In addition, with
X"exec" and "pexec", each argument beginning with "??" is printed without the
X"??" as a prompt for an argument.
X	The parameter noargprompt, if set, inhibits prompting for missing
X$ arguments as described above.
X	The parameter window sets the number of CRT lines available for the
XVSH directory page. If window is less than the full screen, the remaining
XCRT lines is used as a execute scroll window, where all executing commands
Xand text paging is viewed.
X	The parameter column sets the number of filename columns to use
Xin the VSH directory page. Each column uses approximately twenty positions,
Xso a maximum of 4 columns is permitted with a standard 80 column CRT.
X	Commands such as <TAB>, ^N, ^P are available to move a select
Xcursor around the multicolumn directory page.
X	If the parameter VImotion is set, the commands h,j,k,l are acceptable
Xas page motion commands and not interpreted as select commands. If VImotion is
Xnot set, then h,j,k,l are only applicable when the window is 11 or less and
Xotherwise are interpreted as their usual select file function.
X	The parameter MAIL, if set, determines a mail filename to check for
Xnew mail. If the filename ends in ~, it is replaced with the user's name.
X	The parameter moresize, sets the size of the buffer used to store
Xoutput for the VSH pager for later reviewing (reversing). Only moresize
Xprevious characters are saved.
X	The parameter enterpath determines the list of directories to be
Xsearched when entering a file via the keyboard VSH file command. The list
Xconsist of a string of directories separated by ':', in the style of $PATH
Xfor the Bourne shell. A simple '~' denotes the current $HOME, while ~user
Xis replaced with the named user's login directory. The current working
Xdirectory is always searched, though the order may be changed by the placement
Xof a simple ':'.
X	The create command will not create over an existing file unless the
Xgiven filename is preceed by a !.
X	Vsh attempts to ascertain if the terminal is a CRT and has a TERMCAP
Xentry. If vsh fails on these counts, vsh normally will exit. If vsh is given
Xa '-' argument, a non-CRT terminal will cause vsh to chain to the standard
Xshell.
X
All work and no play makes Jack a dull boy
echo doc/vsh.intro
sed 's/^X//' > doc/vsh.intro << 'All work and no play makes Jack a dull boy'
X
X
X
X
X
X                 _A _V_i_s_u_a_l _C_o_m_m_a_n_d _P_r_o_c_e_s_s_o_r
X                          _f_o_r _t_h_e
X                   _U_N_I_X _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m
X
X                   David M. Scheibelhut1
X
X                 Computer Science Division
X  Electrical Engineering and Computer Sciences Department
X                  University of California
X                    Berkeley, California
X                            and
X                     Bell Laboratories
X                 Naperville, Illinois 60540
X
X                          ABSTRACT
X
X
X     _V_s_h is a visual interactive command processor or
X     shell for the UNIX* [1] operating system.  _V_s_h is
X     an attempt to provide a command processor for
X     high-bandwidth video terminals.  This orientation
X     results in the printing of much more information
X     than provided by traditional command processors.
X     This orientation also results in closer control
X     over what is printed so nothing unintentionally
X     scrolls off the top of the screen.  The following
X     set of papers describe _V_s_h.  The first, "A Visual
X     Command Processor for the UNIX Operating System,"
X     describes the goals of _V_s_h and how successfully
X     they have been met.  The second, "Vsh Code Organi-
X     zation," describes the implementation.  The third
X     is a user's manual.  Finally, the appendix con-
X     tains copies of the help files available to the
X     online user.
X
X
X_I_n_t_r_o_d_u_c_t_i_o_n.
X
X
X     A program tends to complement its input/output devices.  For
X
Xexample, batch programs interface to high speed printers.  A batch
X
Xprogram's output tends to be lengthy and detailed, since the printing
X
Xcosts little and extra detail may obviate the need for extra runs.
X
X__________________________
X*UNIX is a Trademark of Bell Laboratories.
X1. Work reported herein was supported in part by the U.
XS.  Department  of  Energy, Contract DE-AT03-76SF00034,
XProject Agreement DE-AS03-79ER10358, and  the  National
XScience Foundation under Grant No.  MCS 7807291.
X
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 2 -
X
X
XExisting UNIX programs have the opposite tendency since they were usu-
X
Xally built for slow, hardcopy terminals.  Because printing takes so
X
Xmuch time, messages tend to be terse, and information is printed only
X
Xwhen specifically requested.  High-bandwidth video terminals benefit
X
Xfrom a different orientation: One does not worry excessively about the
X
Xtime it takes to print messages.  Instead, one is concerned about los-
X
Xing information off the top of the screen before it is used.
X
X
X_O_p_e_r_a_t_i_o_n.
X
X
X     _V_s_h is an attempt to apply this alternative strategy to a command
X
Xprocessor.  _V_s_h is highly visual.  It automatically prints a consider-
X
Xable amount of information, and makes sure that information does not
X
Xscroll off the top of the screen.
X
X
X     _V_s_h is organized around the UNIX file system.  This file system
X
Xhas a hierarchical structure which can be represented as a tree.  Each
X
Xnode in the tree is a directory and each leaf a file.  Each node and
X
Xleaf has a name.  To reference a file one specifies the string of
X
Xnames which traverses the file system from the root to the desired
X
Xfile.  One may also reference files relative to one's working direc-
X
Xtory.  This directory may be set to any accessible directory in the
X
Xfile system.
X
X
X     _V_s_h operates by automatically displaying the members of the work-
X
Xing directory.  Each member is labeled with a lower case letter in the
X
Xfashion of an indexed menu.  To select a member one presses its
X
Xcorresponding letter.  After selection, _V_s_h determines the nature of
X
Xthe file and takes appropriate action.  If the member contains ASCII
X
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 3 -
X
X
Xtext, _V_s_h calls on the editor.  If the member is a directory, _V_s_h
X
Xmakes it the working directory and displays its files.  _V_s_h recognizes
X
Xmany other types of files as described in the user's manual.
X
X
X     Directories with a large number of members cannot be displayed in
X
Xa single screen.  Such directories are broken down into single-screen
X
Xpages.  These pages are selected by typing in their corresponding
X
Xnumber.  To select a file in such a directory, one first selects the
X
Xpage, then the file.
X
X
X     One can do more than select files and directories.  By pressing
X
Xupper-case letters and special characters one can select commands.
X
XThere is a set of basic commands which allow one to create and delete
X
Xfiles, invoke compilers, and perform other basic functions.  One may
X
Xalso define new commands in terms of the basic commands and in terms
X
Xof other programs, and in this way create a personalized environment.
X
X
X     Although the _V_s_h program is not particularly large, it has a
X
Xlarge number of features.  The difficult part in implementing _V_s_h was
X
Xconnecting these parts together so they would coexist in a harmonious
X
Xfashion.  I believe the parts do fit together in a clean manner.  The
X
Xcompanion document to this paper, "Vsh Code Organization," covers the
X
Xdetails of how _V_s_h really works.
X
X
X_V_i_s_u_a_l _T_e_c_h_n_i_q_u_e_s.
X
X
X     The hallmark of visual software is careful control of output.
X
XRelevant information appears on the screen when needed, and does not
X
Xscroll off the top before use.  Because one can only put so much
X
Xinformation on a screen, it is possible to jump between displays in an
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 4 -
X
X
Xeasy, natural manner.  I believe _V_s_h does satisfy these criterion.
X
X
X     The ease of jumping between displays was an important considera-
X
Xtion during the design of _V_s_h.  This emphasis makes _V_s_h an ideal tool
X
Xfor browsing through the UNIX file system, for one can move easily
X
Xbetween the various directories and files.  This convenience also
X
Xextends to the operation of compilers.  When one compiles a program,
X
Xthe compiler error messages are collected in a file and displayed.
X
XOne then selects an error message from the display, and _V_s_h determines
X
Xthe line and file the message references.  An editor is then called,
X
Xediting the file starting at the offending line.  When the error is
X
Xfixed, one can return to the error display to select another.  This is
X
Xa large improvement compared to just dumping the error messages on the
X
Xterminal, because the risk of losing the errors off the top of the
X
Xscreen before use is eliminated.
X
X
X     A visual editor called _V_i [2] has been well received in Berkeley
X
Xwhere one finds little use of the standard editor.  _V_i is similar to
X
X_V_s_h; it automatically displays information (the file being edited) and
X
Xis based on short, often single keypress, commands.  A command proces-
X
Xsor, however, is not an editor.  One does not find the dramatic
X
Ximprovement of _V_i over the standard editor when one uses _V_s_h.  Part of
X
Xthe problem is that _V_s_h does not have the full power and flexibility
X
Xof the standard UNIX command processor.  It seems clear that the use
X
Xof single-keypress commands was just too restricting.  A richer com-
X
Xmand language is necessary.
X
X
X     Historically, _V_s_h was not the first visual command processor, but
X
Xwas inspired by The University of Illinois PLATO [3] system.  With
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 5 -
X
X
XPLATO, everything is visual.  This orientation is in part a result of
X
XPLATO's computer assisted instruction emphasis, and in part a reflec-
X
Xtion on the nature of the PLATO terminal which cannot scroll.  My goal
X
Xwas to merge the best features of PLATO and UNIX philosophies.  A
X
Xresult of this synthesis is _V_s_h.
X
X
X     A major problem with PLATO is that there is no alternative to the
X
Xvisual, interactive way of doing things.  If one wants to edit a
X
Xblock, one cannot specify the block by name.  One must select it from
X
Xthe display.  The _V_s_h _F command allows one to select a file by name,
X
Xeasing the problem somewhat.  A major difficulty remains; one cannot
X
Xeasily consider writing a script of commands for _V_s_h.  Such a script
X
Xwith its single-keypress commands would be unreadable.  Clearly, one
X
Xneeds a traditional command processor for many applications.  The
X
Xissue is whether it is worthwhile to learn both modes of interaction.
X
XAt Berkeley, people are willing to use both types of editors.  Perhaps
X
Xpeople will embrace two shells.
X
X
X_F_u_r_t_h_e_r _W_o_r_k.
X
X
X     It would be interesting to see _V_s_h go beyond its current restric-
X
Xtive status and implement a universally applicable visual shell.  This
X
Xshell would be the focus of a visually oriented programming system as
X
Xavailable in Xerox's Interlisp [4] system.  One can imagine countless
X
Xfeatures.  One would be able to split the screen into sub-displays and
X
Xrun a separate process in each display.  One would be able to recall
X
Xprevious displays.  These features could support utilities such as
X
Xsplit-screen editors.  Communications between users would be facili-
X
Xtated.  Messages from other users would appear in a special display,
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 6 -
X
X
Xrather than just showing up at the bottom of the screen.  One could
X
Xallow others to monitor one's own displays.
X
X
X     Many questions need to be addressed in such a system, including
X
Xthe appearance of the user and operating system interfaces, and the
X
Xappearance of the terminal.  The use of multiple screens, cursors,
X
Xtouch panels, special keysets, and intelligent terminals are areas
X
Xwhich ought to be addressed.  What ever its drawbacks, _V_s_h is a step
X
Xin this direction.
X
X
X_C_o_n_c_l_u_s_i_o_n.
X
X
X     The major flaw of _V_s_h is that it cannot act as a complete command
X
Xprocessor, although I believe such a command processor can be built as
X
Xpart of a visually oriented programming system.  Building such a sys-
X
Xtem would be a major endeavor.  For the time being, _V_i and _V_s_h can
X
Xprovide the flavor of such a system and inspire people to build it.
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X                      February 9, 1983
X
X
X
X
X
X                                - 7 -
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X                      February 9, 1983
X
X
All work and no play makes Jack a dull boy
echo doc/vshelp
sed 's/^X//' > doc/vshelp << 'All work and no play makes Jack a dull boy'
X		A	adb		W	who
X		B	od		X	EXEC
X		C	CREATE FILE	Y	REDO COMMAND
X		D	date		/	ENTER FILE
X		E	SHOWERROR	\	undo chdir
X		G	GREP		#	su vsh
X		H	HOME		(	pack
X		I	tar		)	unpack
X		J	nroff -ms	=	ls
X		L	LONGLIST	;	SHELL COMMAND
X		M	WMAKE		@	rm
X		N	FMAKE		u	uutail
X		O	OPTIONS		v	vi
X		P	ps		x	size
X		Q	du		y	file
X		R	REMOVE		%	CHAIN sh
X		S	SHOWGREP	<ESC>	quit
X		T	tail		^F,+	next page
X		U	su		^U,-	last page
X		V	CHAIN vsh	.	find page
All work and no play makes Jack a dull boy
echo doc/vshrc
sed 's/^X//' > doc/vshrc << 'All work and no play makes Jack a dull boy'
Xvshmode select
Xquitchar [
Xpagechar `
Xentertext display
Xhelpfile ""
Xcolumn 10
Xwindow 11
Xenterpath :/usr/spool:/src:~
X? display /usr/lib/vsh/genhelp.dan
X= pexec ls $
X; xecute
X% exec /bin/csh
X# exec ;su root vsh -
X/ file
X@ exec ;rm -r $
X& xecute ;cc -O -c $ &
X( exec ;pack $
X) exec ;unpack $
X~ file
X` file .
X, pexec sh -c ??Command:
X: exec ;chmod "??New mode:" $"
XA exec ;adb $
XB pexec od $
XF pexec df
XH home
XI pexec tar tvf $
XJ pexec nroff -ms $
XK exec ;notes -i *.*
XP pexec ps -la
XQ pexec du $
XT pexec tail -19 $
XU exec ;su
XV chain vsh -
XW pexec who
XX exec $
Xu pexec uustat
Xv exec ;vi $
Xw exec ;mail
Xx pexec size $
Xy pexec file $
Xz exec ;jove $
All work and no play makes Jack a dull boy
echo doc/vshrc.explain
sed 's/^X//' > doc/vshrc.explain << 'All work and no play makes Jack a dull boy'
X**
X** These are short explanations of the sample .vshrc
X**
Xvshmode select
X	(Put VSH in select mode)
Xquitchar [
X	(<ESC> is the quit character)
Xpagechar `
X	(<SP> is the page character)
Xentertext display
X	(Enter text with the pager rather than the editor)
Xhelpfile ""
X	(No help menu - Note help menus are not compatible with multicolumned
X		directory displays, also '?' is normally bound to
X		"display /usr/lib/vsh/genhelp" and can of course be changed)
Xcolumn 10
X	(Put as many columns of file in the display as possible)
Xwindow 11
X	(VSH file window occupies 11 lines)
Xenterpath :/usr/spool:/src:~
X	(search path for entering files is . /usr/spool /src $HOME)
X? display /usr/lib/vsh/genhelp.dan
X	(Since we changing many commands here, provide a new help file)
X= pexec ls -C $
X	(= executes ls)
X; xecute
X	(; for a shell command, ;; to redraw display immediately upon return)
X% exec /bin/csh
X	(subshell to the Cshell)
X# exec ;su root vsh -
X/ file
X	(/ to enter arbitrary pathname, often to chdir())
X@ exec ;rm -r $
X	(@ to delete an entry, dangerous but faster than R for single files)
X& xecute ;cc -O -c $ &
X	(C compile in background)
X( exec ;pack $
X) exec ;unpack $
X	(Hoffmann encode/decode files, note VSH knows about pcat)
X~ file
X	(same as /, but faster for ~~user)
X` file .
X	(clears a selection)
X, pexec sh -c ??Command:
X	pexec arbitrary command. Like doing: command | more, but internal to VSH
X: exec ;chmod "??New mode:" $
X	Change the mode of a file pointed to. The new mode is prompted for.
XA exec ;adb $
X	(note beginning ';' means return to VSH display immediately after exit)
XB pexec od $
XF pexec df
XH home
X	(like cd)
XI pexec tar tvf $
XJ pexec nroff -ms $
XK exec ;notes -i *.*
XP pexec ps -la
XQ pexec du $
XT pexec tail -19 $
XU exec ;su
XV chain vsh -
X	(If you change .vshrc, this command will also update your current VSH)
XW pexec who
XX exec $
Xu pexec uustat
Xv exec ;vi $
X	(since entertext is display, this is to use the screen editor)
Xw exec ;mail
Xx pexec size $
Xy pexec file $
Xz exec ;jove $
All work and no play makes Jack a dull boy
exit