pudb icon indicating copy to clipboard operation
pudb copied to clipboard

Add restart hotkey

Open s-redko opened this issue 2 years ago • 7 comments

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.

s-redko avatar Nov 12 '23 21:11 s-redko

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?

inducer avatar Nov 12 '23 23:11 inducer

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

s-redko avatar Nov 12 '23 23:11 s-redko

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.

asmeurer avatar Feb 09 '24 00:02 asmeurer

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.

asmeurer avatar Feb 09 '24 00:02 asmeurer

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?

s-redko avatar Feb 09 '24 02:02 s-redko

You can just push to this branch.

inducer avatar Mar 22 '24 17:03 inducer

Done. I've been using it for a while now locally. I'm happy with this solution.

s-redko avatar Mar 26 '24 21:03 s-redko