[Techtalk] bash and inputrc

Wim De Smet kromagg at gmail.com
Thu Jan 13 08:28:52 EST 2005


On Wed, 12 Jan 2005 10:17:04 -0800, Akkana Peck <akkana at shallowsky.com> wrote:
> I asked:
> > > Anybody used .inputrc successfully to change bash's key bindings?
> 
> John Clarke writes:
> > and loaded it:
> >
> >     [jrc at zeus ~]$ bind -f .inputrc
> 
> Thanks -- I didn't know about the options to the bind command,
> and knowing -P and -f are making it easier to test this.
> 
> I have it working now on the woody machine -- it turned out woody's
> readline needs the backslash before the key modifiers, which sarge's
> readline doesn't, so \C-w and not C-w -- but it still doesn't work
> on sid, and running bind -f .inputrc doesn't change anything.
> 
> I wondered whether maybe this was because some recent change is
> making it pickier about overwriting keys that are already bound,
> so I thought I'd try removing the existing key bindings:
> 
> bind -r '\C-w'
> bind -r '\C-h'
> 
> Those commands don't return any errors, but typing C-w and C-h
> still do the same thing they always do.  So it looks like the "bind"
> command isn't doing anything at all, either for setting new bindings
> or removing old ones.  Indeed, typing commands like
> 
> bind '\C-h':backward-kill-word
> bind "\\C-w":backward-kill-word
> 
> directly don't change anything either.
> 
> I also tried the beginning/end of line bindings you used as
> examples; the system default bindings already have "\M-[H"
> bound to beginning-of-line, and running your .inputrc lines
> doesn't add "\e[H" as a binding, if it's actually different.
> None of the existing \M- bindings work when I type them,
> anyway, whether with alt, the "windows" key, or esc, so I've
> been using mostly \C- bindings for testing.
> 
> I wondered if it might be modifying the wrong keymap, but
> bind -V says the keymap is emacs, and adding -m emacs to the
> bind commands doesn't help.
> 
> This machine has both libreadline4 version 4.3-15 and
> libreadline5 5.0-7.  But ldd /bin/bash doesn't mention readline,
> so maybe bash has its own compiled-in version (it's bash 3.00.16(1),
> but that doesn't tell me what libraries were used to compile it).
> 
> Any thoughts?  Is there any way to get bind to be more verbose about
> errors or problems?  I don't see anything in the discussion of bind
> under bash(1).

More about inputrc can be read in man readline5. Apparently the bash
distribution indeed does include readline (and links it statically).
This is probably to be able to use bash on a minimal system. In any
case, the more I read, the more I think this may just be a recent bug
(the behaviour in sid). Maybe the shortest way to an answer would be
to file one against bash? (after checking that manpage off course)

In any case, I think some more documentation about what readline
implementation it is and how to configure it, included in the package,
would be very helpfull. So I think it would be helpfull to ask the
maintainer to do that.

Greets,
Wim


More information about the Techtalk mailing list