Python debugger (pdb) stopped handlying up/down arrows, shows ^[[A instead

后端 未结 3 1667
萌比男神i
萌比男神i 2020-12-18 18:31

I am using python 2.6 in a virtualenv on an Ubuntu Linux 11.04 (natty) machine. I have this code in my (django) python code:

import pdb ; pdb.set_trace()


        
相关标签:
3条回答
  • 2020-12-18 19:06

    I found this problem exists when outputting to both console and file using python file.py 2>&1 | tee output.txt:

    How to redirect stdout to both file and console with scripting?

    After removing 2>&1 | tee output.txt, this problem (up arrow becomes ^[[A in pdb) disappear.

    0 讨论(0)
  • 2020-12-18 19:06

    See Python interactive mode history and arrow keys. In my case, Amadan's answer worked; I already had the readline module.

    0 讨论(0)
  • 2020-12-18 19:11

    Looks like from some reason you are missing the readline package. Simply install it by typing pip install readline and it should behave as expected. Remember to type it as superuser if you're not in venv.

    0 讨论(0)
提交回复
热议问题