gnifty
... professional ... personal ... code ... Gnifty <<< Personal <<< Blog

 ...  Using HOME and END in BASH  ...  0 Comments  ... 

On a few of my Debian systems which have been upgraded in-place several times, I have had the frustrating problem of being unable to use the home and end keys in bash. Instead of going to the front or end of the line, they just insert a tilde instead. Today I found a little time to research it and I might as well document what I found here so I can find it again.

The file which controls this behavior for bash on a Debian system is ~/.inputrc or if that does not exist, /etc/inputrc and in my case, /etc/inputrc was an old version which was missed during upgrades. I fetched a copy of the file from a system I recently installed and presto, bash is behaving just like I expect.

Here are the specific lines from the file (commented out in the old version):

# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

 1