[CLUE-Tech] vi form of command history editor in bash?

Dave Anselmi anselmi at americanisp.net
Wed Dec 19 10:34:42 MST 2001


BOF wrote:

> I found this somewhere I don't recall, but it seems to work.
>
> Question: Why does command line editing fail on Red Hat when I put "set
> -o vi" in my .bashrc file?
>
> Answer: Some settings in RedHat's /etc/inputrc file conflict with vi
> mode. This is what causes command line editing to fail completely when
> you add "set -o vi" to your .bashrc. The inputrc file is being read
> because /etc/profile sets your INPUTRC variable to /etc/inputrc.   One
> way to get around this problem is to put "unset INPUTRC" in your
> .bash_profile file. That should allow your "set -o vi" command in
> .bashrc to work. This would also allow you to create your own .inputrc
> file to further refine the way your commandline works.   Another way is
> to put all of the keymappings in /etc/inputrc inside some if statements
> that test to see whether the mode is emacs or not: $if mode=emacs
> "\e0d": backward-word  "\e0c": forward-word  ..  $endif

Thank you!!!!  That turns out to be the problem I was having on the CLUE
server.  Making an empty ~/.inputrc fixes it.  Unsetting INPUTRC may not
work, as it may get reset when you start a new shell.  Depends on how
/etc/bashrc and /etc/profile are set up.

Dave





More information about the clue-tech mailing list