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

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


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.


I had the same problem, but I finally figured out.

0x00 Cause
I don't know for sure. But since re-install helps, I guess the previous version of python was not installed correctly.

0x01 Solution (0 - recommended)

This is a better solution.

Reinstall conda by:

  1. See all your environment by conda activate and conda env list
  2. Back up ALL your current settings conda env export -n {your_env_name} > {your_env_name}_condaenv.yml
  3. Uninstall conda (See Official Guide)
  4. Reinstall conda (See Official Guide)
  5. Import environments by conda env create -f {file_name_you_saved}.yml

0x01 Solution (1 - not recommended)

WARNING: this solution only let you install a new python that works, which is not recommended.

  1. type pip see if you have installed pip
  2. If you get Command 'pip' not found, but can be installed with:sudo apt install python-pip then you need to install pip first.
  3. Check if the problem solved. If not, use pip install gnureadline
  4. The problem should be solved.

0x02 Possible Duplicates (but none of them are answered):

  1. https://superuser.com/questions/641095/bash-how-to-globally-fix-h-and-backspace-problems
  2. Backspace character weirdness

0x03 Reference