Arrow keys, home and end do not work in django terminal

I am using django 1.2.5 and python 2.7. For some reason, the terminal type is wrong in the django shell, and this annoys me. If I push up, down, right, left, I get the following:

>>> ^[[A^[[B^[[C^[[D 

This only happens in the ./manage.py shell . This is not a problem in a regular python interpreter, and it happens regardless of whether the screen is on. Any thoughts?

EDIT: This is the result of import code; code.interact() import code; code.interact()

 Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) 
+4
source share
1 answer

If you are using Ubuntu, you just need to restart the terminal. I had that the terminal started acting funny for no apparent reason. Although in my case, clicks and mouse movements will be printed as lines with odd characters.

0
source

All Articles