Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ newshell(1) — UNIX 2.9BSD

Media Vault

Software Library

Restoration Projects

Artifacts Sought

NEWSHELL(1)  —  Unix Programmer’s Manual

NAME

newshell − New C shell with tenex-like file name and command completion

DESCRIPTION

We have installed an enhanced version of the Berkeley UNIX C shell csh (1).  It behaves exactly like the C shell, except for the added utilities of:

1) Interactive file name, command, and user name recognition and completion. 

2) Command/File/Directory/User list in the middle of a typed command. 

3) Optional timer for automatic logout after selected idle time. 

4) Terminal mode sanity checking. 

5) Saving history between logouts. 

A description of these features follows.  For information on the other standard csh features, please see "man csh". 

1. FILE NAME COMPLETION

In typing file names as arguments to commands, it is no longer necessary to type a complete name, only a unique abbreviation is necessary.  When you type an ESCAPE to csh it will complete the file name for you, echoing the full name on the terminal. 

If the file name prefix you typed matches no file name, the terminal bell is enunciated.  The file name may be partially completed if the prefix matches several longer file names.  If this is the case, the name is extended up to the ambiguous deviation, and the bell is enunciated. 

Example

In the following example, assume the plus character “+” is where the user typed the ESCAPE key.  Assume the current directory contained the files:

   DSC.OLD    bin        cmd       lib        memos
   DSC.NEW    chaosnet   cmtest    mail       netnews
   bench      class      dev       mbox       new

The command:                 % vi ch+ would cause csh to complete the command with the name chaosnet.  If instead, the user had typed:                 % vi D+ csh would have extended the name to DSC. and enunciated the terminal bell, indicating partial completion. 

File name completion works equally well when other directories are addressed.  In addition, the tilde (~) convention for home directories is understood in this context.  Thus,                 % cd ~speech/data/fr+ does what one might expect.  This may also be used to expand login names only. Thus,                 % cd ~sy+ does a cd to the synthesis directory. 

2. FILE/DIRECTORY LIST

At any point in typing a command, you may request "what files are available" or "what files match my current specification".  Thus, when you have typed, perhaps:                 % cd ~speech/data/bench/fritz/ you may wish to know what files or subdirectories exist (in ~speech/data/bench/fritz), without, of course, aborting the command you are typing. Typing the character Control-D at this point, will list the files available. The files are listed in multicolumn format, sorted column-wise. Directories and executable files are indicated with a trailing ‘/’ and ‘∗’, respectively. Once printed, the command is re-echoed for you to complete.

Additionally, one may want to know which files match a prefix, the current file specification so far.  If the user had typed:                 % cd ~speech/data/bench/fr followed by a control-D, all files and subdirectories whose prefix was “fr” in the directory ~speech/data/bench would be printed. Notice that the example before was simply a degenerate case of this with a null trailing file name. (The null string is a prefix of all strings.) Notice also, that a trailing slash is required to pass to a new sub-directory for both file name completion and listing. 

Notice, the degenerate case                 % ~^D will print a full list of login names on the current system.

3. COMMAND NAME RECOGNITION

Command name recognition and completion works in the same manner as file name recognition and completion above.  The current value of the environment variable PATH is used in searching for the command.  For example                 % newa+ might expand to                 % newaliases Also,                 % new^D would list all commands (along PATH) that begin with "new".

As an option, if the shell variable listpathnum is set, then a number indicating the index in PATH is printed next to each command on a ^D listing. 

4. AUTO-LOGOUT

A new shell variable has been added called autologout.  If the terminal remains idle (no character input) at the shell’s top level for the number of minutes greater than the autologout value, you are automatically logged off.  This feature was added primarily for security reasons as people often forget to log off when they leave, permitting anyone to walk by and peruse your mail, or private files. 

The autologout feature is temporarily disabled while a command is executing.  The initial value of autologout is 60.  If unset or set to 0, autologout is entirely disabled. 

5. SANITY

The shell will now restore your terminal to a sane mode if it appears to return from some command in raw, cbreak, or noecho mode. 

6. SAVEING HISTORY

The shell now has the facility to save your history list between login session.  If the shell variable savehist is set to a number then that number of commands from your history list is saved.  For example, placing the line

        set history=50 savehist=50

in your .cshrc file maintains a history list of length 50 and saves the entire list when you logout, to be retored when you login next.  The commands are saved in the file .history in your login directory. 

F.Y.I.

This shell uses neither raw or cbreak mode.  It works by (temporarily) setting the "additional" tty break character to ESC.  There is no overhead usually associated by programs which run in raw or cbreak mode. 

If you select ESC as your default additonal break character, then you will be able to do recognition on typeahead. 

The "vb" (visible bell) is used in place of the terminal bell if it exists in the termcap entry for your terminal. 

FILES

/usr/local/lib/builtins/∗ - fake list of builtin commands /etc/termcap - to discover vb (visible bell)

SEE ALSO

csh (1)

BUGS

A control-D on a blank line (a degenerate case of the List command) logs you out, of course.  (But try <space><control-d>, which lists all commands on the system along PATH). 

It would be nice if you could change the command characters to something else and not just be stuck with ESC and ^D. 

Typing immediately after hitting ESC before recognition expansion completes will result in character juxtaposition or loss. 

Your terminal type is examined the first time you attempt recognition only. 

AUTHORS

Ken Greer, HP Labs; Mike Ellis, Fairchild, added command name recognition/completion. 

7th Edition

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