After saving the bash history appropriately (as described in the previous post Bash history – how to get the most out of it) you will also want to make sure that working with the history during the session is as easy as pie. For that you will have to adjust the .inputrc file.
Traditionally the terminal/console would emulate all kinds of behaviors depending on your historical terminal access to the computer/mainframe. This unfortunately led to a combinatoric explosion of possible key events and configurations, which makes the successful configuration of the .inputrc rather tedious and annoying.
All I wanted is to use the arrow keys as well as page up and page down, home and end to navigate the commands and the history.
The bash can do that, no doubt, several decades of programming knowledge have been distilled in it, but making it behave according to my needs, well, that was a matter of patience.
The .inputrc-file contains all the key-stroke specific information to make sure the bash behaves as you want it to. Unfortunately, the syntax of the the key-stroke pattern is completely brain-dead. This is why I’m trying to reproduce here as many of the keys as possible, just so that I don’t have to go on another Internet odyssey to find them all.