[TriLUG] bash + escape key under rh72

Marc Johnson marc_johnson27591 at hotmail.com
Tue Nov 6 20:58:49 EST 2001


On my system, the configuration of which I have not modified, completion 
works by either pressing the tab key, or by pressing the escape key twice.

I found this out by reading (useless? not to me!) 'man bash'. And, mind you, 
my comprehension of the material on key binding was greatly enhanced by my 
long familiarity with emacs ...

Anyway, I found out what would invoke the 'complete' command by typing:

bind -q complete

in the output, it says:

complete can be found on "\C-i", "\e\C-[".

Again, from the man page, I know that \C is shorthand for the control key, 
and \e is shorthand for the escape key, so the 'complete' command is bound 
to ctrl-i, and to escape ctrl-[. Given the equivalence of ctrl-i and tab, 
and that of ctrl-[ and escape, then the tab key, or the escape key twice, 
will incoke the 'complete' function.

Now ... if your bash is configured (and by default, it is) to use emacs key 
bindings, trying to remap escape by itself as invoking the 'complete' 
function is a bad idea, as escape is a comamnd prefix.

If you set up bash to use vi bindings (set -o vi will do that), you'll find 
that escape is bound to 'vi-movement-mode', and tab (and tab only) is bound 
to 'complete'. I believe you could coax that into changing, certainly more 
easily than in emacs mode.

A stroke of the brush does not guarantee art from the bristles.
- Kosh Naranek


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




More information about the TriLUG mailing list