Add restart hotkey
It's useful to be able to restart debugging session quickly without using q command and selecting <Restart> from the UI.
It also remove the need to have Prompt before quitting enabled so pudb can be closed faster as well.
How about adding an "r" binding in the quit dialog, here:
https://github.com/inducer/pudb/blob/8c8f9d4a25e226e77a18d4d938eecf2f969e9b32/pudb/init.py#L197
Then you could hit "qr" in quick succession and get the same result?
How about adding an "r" binding in the quit dialog, here:
I didn't know about that. However it still two keystrokes instead of just one.
I'll try to explain my motivation in more details.
When I try to find out where the error is coming from it usually requires multiple restarts while playing around with breakpoints. So it is very convenient to have single hotkey restart option.
Once bug is identified and I'm trying to fix it or add more debugging code I'm also following edit -> restart -> edit cycle.
Lastly it's very handy to be able to just hit q and close pudb immediately (Prompt before exit disabled)
I've happy to change r hotkey to something else. I just felt natural to use r for restart. Especially since r and f trigger the same action.
I also would like to add code switch focus to the code window inside restart function. I found that I usually call it from Breakpoints window and then have to switch to Code window. to hit c.
I do understand that it's just my workflow and might not apply for the majority of the users so I follow your suggestions. Cheers
I like the qr idea. I'm a little hesitant to mapping a single key to restart because it would be too easy to press accidentally. Unless of course it pops up a confirmation dialog, but that sort of defeats the purpose and would be no different from qr.
By the way, we should indicate the Q in "quit" is a shortcut in the same way we do for the "variables" and "breakpoints" headers.
Should I revert my changes and add mapping of r shortcut to quit dialog box in thin PR? Or should I close this one and create a new one?
You can just push to this branch.
Done. I've been using it for a while now locally. I'm happy with this solution.