Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When ~/.inputrc does not exist, hitting Ctrl+Left Arrow and Ctrl+Right Arrow on a Bash command line moves the cursor back and forward by one word, respectively.

However, if ~/.inputrc exists (regardless of whether or not it's empty), those two key combos result in ;5D and ;5C being printed where the cursor is instead of moving the cursor.

How can I fix that?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Its because if the file exists, bash uses your local settings for the readline settings instead of the default one.


"When a program which uses the Readline library starts up, the init file is read, and the key bindings are set."

The recommendation in the sample file at is to source the default in your local one with a line like this:

$include /etc/inputrc

and then modify from there.

share|improve this answer

set -o emacs in your ~/.profile should do it.

share|improve this answer
I put set -o emacs in ~/.profile and ran touch ~/.inputrc . Unfortunately, the CTRL+LARROW and CTRL+RARROW keys still caused ;5D and ;5C to be printed instead of moving the cursor. – nickh Apr 30 '13 at 14:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.