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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do the right thing and put my key bindings into ~/.inputrc.

However, it turns out that I have to change

bind '"\e\C-j":"\e[1~quiet \e[4~\n"'


"\e\C-j": "\eOHquiet \eOF\n"

Now \eOH (nav-block-pos1 bound to beginning-of-line) and \eOF (nav-block-end bound to end-of-line) are themselves bindings in my configuration which I possibly cannot always rely on.

So the main question is why does binding to num-block-pos1 (\e[1~) and num-block-end (\e[4~) work with bind but not in my ~/.inputrc?


The whole thing is getting even more complicated, now that I realized that \e\C-j only works for Gnome Terminial (or probably xterm as well, who knows...).

For my TTY it has to be

"\e\C-m": "\e[1~_quiet \e[4~\n"

So is it that various VTs have different implementations of how to interpret keys or what?

share|improve this question
This is documented in the GNU Readline User Interface manual, section 1.3. The keymap option is used to set what kind of key representation is used in key bindings definitions. Relevant information:… – Ярослав Рахматуллин Dec 5 '12 at 0:09
@ЯрославРахматуллин How exactly is this relevant to the difference in behavior between using bind and using inputrc for the actual binding. Should they not use the same settings? – user173944 Dec 5 '12 at 6:15

Your terminal emulator can operate in one of two modes: application mode, and cursor mode (see It depends on what mode your particular application runs in that determines what escape sequence you need to send.

share|improve this answer

Your Answer


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