Skip to content
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

Improvement: add a shortcut to enter the debugger after an error occurs #5205

Closed
impact27 opened this issue Sep 11, 2017 · 7 comments · Fixed by #11186
Closed

Improvement: add a shortcut to enter the debugger after an error occurs #5205

impact27 opened this issue Sep 11, 2017 · 7 comments · Fixed by #11186

Comments

@impact27
Copy link
Contributor

Quite often, when I run a script that crashes, I launch the debugger with:

import pdb
pdb.pm()

It would be useful if there was a keyboard shortcut and a menu item to do that.

Also when the post mortem is launched, the corresponding file is not automatically opened, so I usually do a u then d and the correct line appears.

@ccordoba12
Copy link
Member

There's already a menu item to enter post mortem debugging in

Run > Configuration per file > General settings > Directly enter debugging when errors appear

I think that covers this use case, right?

@impact27
Copy link
Contributor Author

Well not exactly as I don't want to enter debugging every time. I was thinking of something like: "debbug last error in console" if I can't figure out what the error is about just by looking at the trace.

@ccordoba12
Copy link
Member

I see. You can also enter debugging after an error occurs by using the %debug magic. Is that closer to what you want?

@impact27
Copy link
Contributor Author

impact27 commented Sep 14, 2017

Yes, but that is not very different from typing pdb.pm(). I just thought it would be cool to have a keyboard shortcut for this. The rationale behind a menu item would be that a new user may not know about the magic commands but this is a cool feature to use.
For comparison, there is a button and a shortcut to stop debugging when typing q does the same thing. Why not add a button for "Debug last error"?
This is not really a missing feature but I thought it could be useful for a new user.

@ccordoba12
Copy link
Member

It's not a bad idea, and it shouldn't be that hard to implement. The only thing that is not quite clear to me is what icon to use for this in the Debug toolbar.

You're welcome to give it a try!

@impact27
Copy link
Contributor Author

backtoerror

@ccordoba12
Copy link
Member

@goanpeca is working on a new icon set for Spyder 4, so we should wait until he replaces our current set for the new one before taking a look at this functionality.

@ccordoba12 ccordoba12 changed the title Improvement: add a shortcut for pdb.pm() Improvement: add a shortcut to enter the debugger after an error occurs Jul 11, 2020
@ccordoba12 ccordoba12 modified the milestones: wishlist, v6.0alpha1 Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants