views:

195

answers:

3

I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb.

When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window.

The Input is still being captured as I can see the Standard Output.

E.g. in pdb.set_trace() I can 'l' to display where I'm at in the code. However, the 'l' will not be displayed, just an empty prompt.

This makes it hard to debug because I can't determine what I'm typing in.

What could be going wrong and what can I do to fix it?

A: 

Try installing readline on Mac OS X:

$ sudo easy_install readline

This is a blind guess, but perhaps it solves your problem.

reto
I'm already using readline 2.5.1
BryanWheelock
what's easy_install?
hhafez
see http://en.wikipedia.org/wiki/Easy_install
reto
A: 

If you exit pdb you can type reset and standard input echo will return. I'm not sure if you can execute something similar within pdb. It will erase what is currently displayed however.

mtnpaul
A: 

Maybe this is because there was an error while running Django. Sometimes it happens that the std input disappears because stty was used. You can manually hide your input by typing:

$ stty -echo

Now you won't see what you typed. To restore this and solve your problem just type

$ stty echo

This could help.

cb0