I have the following entries in my ~/.inputrc file:

"\e[A": history-search-backward
"\e[B": history-search-forward

Normally, this works fine. For example, if I type 'ss' then press up or down, I can scroll through all commands in my history that start with 'ss' (such as ssh logins).

However, sometimes I log into my server and these bindings do not work. When I type 'ss' and press up, it instead scrolls through my bash history normally, instead of matching based on the letters I typed.

I tried all the methods described here to try and reload the .inputrc file to re-enable these bindings, but it does not work. Logging out and logging back in does not work. Starting a new bash shell in a new terminal window, or from within the current session, does not work. Pressing 'Control-x', 'Control-r' does not work. The .inputrc bindings refuse to work again, until some random time in the future when in a new session (or maybe the current session?) they decide to start working again. This has been going on for years and I've just lived with it, but it would be nice to figure out what is causing it to stop working, and how to get it to start working again.

The systems I use include:

  • Mac computers running macOS 10.10 - 10.12, running iTerm2

  • RHEL 7 servers (logged in from the Mac)

  • Centos 6 servers (logged in from the Mac)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.