-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminal input issues after restart during PDB session #689
Comments
I dont know how to fix this (I've lived with it for years now) but a workaround is just to always press "c" to continue the program before pressing ctrl-C to exit. |
In bash and zsh you can use the "reset" command in the terminal to fix it. You can't see it while you type it, but it works. This is a readline and pdb issue and not related to pyramid. |
On 09/13/2012 04:11 PM, Sapphire64 wrote:
This is an issue with PDB, not with Pyramid. |
Some people also use "stty sane" |
"stty sane" and "reset" works great for me, thanks! Maybe it will be great to include subprocess.Popen("stty sane") into web server provided with pyramid to execute on each start and restart (for compatible OS and shells ofcource)? Looks like this command's impact on console experience not so destracting, not like when executing "reset". Probably, it is too complicated to implement, but maybe it is possible to handle at least ^C and launch "stty sane" then - after (hopefully) the moment when all breaks. Anyway, thanks for reply! |
Unlikely to do that, given how complex terminal emulation can get cross-platform (not to mention on non-UNIX systems). Thanks for the report, though! |
I'm running into this issue, too. Django fixed this - see Runserver reloading breaks terminal STDIN when using pdb.set_trace(). I found this through iPython - “broken” shell/terminal after realoading Django. We could do the same or at least provide some hook fired when server is restarted so that users could hook needed code themselves. |
Thanks for the reference, Piotr. FTR, the Django diff referenced as fixing that issue is here: |
…#689) Also add myself to CONTRIBUTORS.txt
…#689) Also add myself to CONTRIBUTORS.txt
Backport fix for terminal echo after reload (refs #689)
Hello again :) I have issues on two of my systems - both amd64 Debian Wheezy with KDE 4.8.4. Both reproducible in python 2.7 and in python 3.2.
Description:
When I'm adding
import pdb; pdb.set_trace()
into my Pyramid's project code I have possibility to debug it with interactive interpreter. This is very cool, but 2nd or 3rd restart (by ^C or automatically) breaks this cool feature - I can't see nothing what I'm typing in terminal - just blank input line:"(Pdb) {always blank here} ".
Any input actually works (but somewhat weird), but it does not echo this input in terminal. So I always have to close this terminal window, open new and start
../bin/pserve development.ini
again.To describe more this issue: when I'm typing
su
in this broken terminal it gives me only a second to type password and then it automatically press 'enter' so system responds with "Wrong password".This issue easily reproducible on both of my systems, in py2 and py3 pyramid projects, in Konsole, Yakuake and XTerm terminals.
I'm not sure what can it be, maybe not exactly Pyramid bug, but maybe bug of Pyramid's webserver or pdb module itself. Looks like this is not an issue of terminals - even if Konsole & Yakuake are almost the same inside, oldschool XTerm quite differs from them. Maybe I should try to reproduce this in system's tty terminal.
The text was updated successfully, but these errors were encountered: