-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Need command to exit PDB interactive shell #85268
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
Comments
In PDB, when you use "interact" to enter an interactive shell, the only way to exit that shell is to send an end-of-transmission (Ctrl+D) character. In some environments, such as Jupyter, this is awkward to do. Here is a StackOverflow post where a user encountered this issue: I think that the user should be able to type quit() in order to exit the interactive Python shell and go back to the PDB shell, similar to a regular interactive Python session. I think you should also support exit() because the Python shell supports that one as well (quit() and exit() do the same thing, I think the alias exists to help discoverability for new users). I confirmed this issue on Python 3.6.9 and 3.8.3. |
Both "exit" and "quit" and even just "q" quit the PDB interactive shell. |
Serhiy: I'm referring to the interactive mode that can be entered by typing "interact" in PDB. Here are reproduction instructions:
Now, in this "PDB InteractiveConsole" shell (I'm not sure what it's called), the only way to go back to PDB is to press Ctrl+D. If you type "quit()" or "exit()" it exits the entire Python process. If you type "q" it says "NameError: name 'q' is not defined". In Jupyter, I get different (but still undesirable) behavior: "quit()" raises "NameError: name 'quit' is not defined" (and similar for "exit()"). I think "quit()"/"exit()" in these contexts should return you back to the PDB shell. |
Thank you, now I understand the problem. It is reasonable request, but a new feature can only be added in Python 3.10. |
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: