<back space> not functional in python and ipython in shell

Python version : Python 3.5.4 |Anaconda custom (64-bit).

Ipython version : IPython 4.2.0

Problem: Backspace key misbehaves. It brings the cursor forward a few spaces like the tab key...

I'm running bash version: GNU bash, version 4.4.12(1)-release (x86_64-unknown-linux-gnu)

on linux manjaro 17.0.6 Gallivera.

kernel 4.9.58.1-manjaro

I expect it's the Anaconda Python installation as the python 2.7 behaves normally.

This version of Anaconda and IPython I can't really update, because of competability issues with Emacs-python-mode so I don't know in what way I can test what is causing the problem.

According to https://blog.csdn.net/qq_29695701/article/details/90715653

I added

export TERMINFO=/usr/share/terminfo

to my .bashrc file and it worked!

Miniconda (or something related to conda's Python) seems to have a problem with Manjaro's default $TERM variable. In my case, it was rxvt-unicode-256color. When I set it to xterm, the problem went away.

You can do this by running export TERM=xterm.

I'm still not sure why this problem occurs, and why only occasionally, but this fixed it for me.

Comments
  • Does ^H (control H) work?
  • when I run shell in emacs ( M-x shell) and run ipython there it works perfectly, What does that mean? It point that the problem is in bash, no?
  • @tadman . ^H doesn't work. It goes forward one space. and yes it does work in rhe shell generally, just not when python runs.
  • Seems like an stty issue of some sort. Most of these REPL tools use readline which is pretty good at picking up on your settings.
  • @tadman I believe newer versions of Ipython dropped readline: ipython.readthedocs.io/en/stable/whatsnew/…
  • Works like a charm and I prefer this solution over setting $TERM, because $TERM has influence on other programs such as vim or tmux.