[net.unix-wizards] A modest suggestion for the C-shell

davidson (05/27/82)

Actually, not adding repeated commands has a rather negative effect,
namely that frequently used (through being repeated) commands can
roll off the history list.  What I believe is the correct solution
is to move commands when they are repeated to the head of the history
list.  As a recently performed command, they belong there, but it is
simply redundant to leave the original command on the list.  Of course
this should not affect the command numbers associated with commands.

As long as we are talking about history mechanisms, I would like to
mention my favorite method:  Entered commands are spooled off onto
a file, and can be browsed through by using the up and down arrows,
as on some HP terminals.  There is a character code which will move
one back to the end of the history list (also a feature of those HP
terminals), but another command copies the current line to the end
and takes you there, where you can perform the command simply by
hitting return, or you might want to edit it first (using left and
right arrows, backspace and ordinary characters, which are self
inserting as in modeless editors).

In UNIX I use a similar system by using vi as a shell.  Typing a
command, then Yank, Put, !!csh allows one to have an editable history
of commands, followed by the output of the commands.  Appropriate
mappings allow me to use my terminal's function keys to do this in
a more natural fashion.  When I get an undesired effect from a command,
I merely type u for undo, edit the command, and then the perform
key (!!csh^M) again.  This is not suitable for non-line oriented
commands; however, so I :! them separately.  I would prefer to be able
to keep a record of them with the others, but I havn't thought of
a way.

I understand that Goslings EMACS can be used in a similar fashion,
but I havn't tried it yet.  Until recently we only had a very old
version of EMACS, but as soon as our new copy of it is installed
I'm going to see how it works as a shell.

Greg Davidson

smb (05/28/82)

I'd rather leave the history mechanism the way it is now.  I often
find it useful as a recod of what commands I've issued, to say nothing
of how useful it is when answering questions like "why didn't the
foo command work with the -bar option?"


		--Steve Bellovin