Hi Daniel,

> One thing I really like about ..... wait for it, MS-Dos is that I press the
> escape key and it clears the command line.
 
> Can anyone point me in the right direction about how I could set this up in
> bash.

In bash (both vi and emacs editing styles) control-u does this for you.
If you can train yourself to use control-u to kill your line, you should
be happy. Incidentally, you can get back what you've killed with control-u
by doing a control-y (yank); this is a cut-and-paste feature in bash.
Even more crazily, you can get back the last few things you've cut with
control-u by hitting escape-y repeatedly (emacs mode only). I mention this just to 
show the
power of bash/readline; I don't use this one myself.

Escape is used so much in both vi/emacs modes that you probably don't want
to make the escape key your line-kill character.

The function run by control-u is called "unix-line-discard" and you can 
make keys besides control-u through the ~/.inputrc file. See the bash man page
for details; search for "inputrc".

Good luck,
Stuart.
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to