In ipython, if I press ‘esc’ followed by ‘enter’ (and possibly other characters?), readline breaks. I can no longer search through command history using the ‘up’ key, and some commands (e.g., control-K) fail.
Is there a way to reset readline within an ipython session? What is going on when I press these keys?
The poster’s suggested answer doesn’t seem to work for me in iPython 0.12+. I can run:
but that doesn’t seem to help.
However I noticed that I sometimes see similar problems in my iPython sessions. It appears that I had inadvertently switched from the default Emacs readline editing mode to vi-mode(vim-mode). According to the the readline docs to switch between them you are supposed to be able to use the M-C-j key combination but that only seems to allow me to switch to vi-mode. To switch back to Emacs mode one can use C-e but that didn’t appear to work for me – I had to instead do M-C-e – on my Mac (where ESC is used as the ‘Meta’ key) it is: ESC+CTRL+e
The contents of my ~/.inputrc is as follows: