Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 using ipython

Inside the python shell, when I press up instead of showing the last command, it prints


also CTRL-[keys] are fubar. CTRL-p prints


Everything is normal under terminal\bash

My guess is that it is an encoding problem. I'd like to either enable the full encoding in ipython or changer the encoding of the shell which runs ipython.

Or any other helpful information is welcome

share|improve this question

For me, I needed to create ~/.inputrc, and fill it with my preferences. For me, this is:

set editing-mode emacs
"\e[1;5C": forward-word
"\e[1;5D": backward-word

The \e[1;5C, for me, is the sequence that means Ctrl+. Yours is likely the same, but you can figure it out in bash by typing: Ctrl+V, Ctrl+. For me, this shows, ^[[1;5C, and you need to know that ^[ means "escape", which is the \e above. The rest ([1;5C) is just literal, copy it. forward-word is the command to execute on this key sequence, i.e., I want my Ctrl+arrows to skip words.

share|improve this answer

First, you can try

pip install readline

Also, please see whether you have libncurses5-dev or the equivalent.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .