Fixing shell keyboard shortcuts

Some weeks ago, I faced the problem that the navigational shortcuts on the shell did not work anymore. Key combinations like Ctrl+Left and Ctrl+Right that are supposed to move the caret between words in your terminal, just produced output like ;5D and ;5C.

I had absolutely no idea where this came from or why it was broken. At first I suspected a package upgrade somewhere deeply, but nothing relevant had been installed or upgraded in the last days. I tried to live with it, but after some days I became really annoyed and began looking for a fix.

The guys at #xfce could not help me - I suspected it was the Terminal application until I noted that only my main user ("cweiske") had these issues, but all other users I sudo'ed to did not!

So it had to be some of my profile settings. Renaming .bashrc and .xinitrc did not help at all. The only thing left was looking at the files that are opened by a new shell - strace is my friend here.

stracing for the win

The command I used was:

strace -e open -o log-cweiske bash

I ran that as my main user and as one user that did not have the keyboard problems. As soon as I had both log files, a diff revealed the problem's source:

 open("/home/cweiske/.inputrc", O_RDONLY) = 3

Some days ago I enabled case-insensitive bash completion by writing

set completion-ignore-case on

in my personal .inputrc file. I did not know that there was a /etc/inputrc file that I overwrote now and that was not loaded anymore now I had my own version of it. Copying the contents of the /etc variant into my personal file and appending my completion-ignore-case statement fixed the ctrl keys problem!

I'm looking for a new job. If you can recommend a company in Leipzig/Germany that's looking for a PHP developer, please drop me a mail.

Written by Christian Weiske.

Comments? Please send an e-mail.