Ipdb with prompt_toolkit#9487
Conversation
|
This will be great, when done! (Just providing encouraging words of support :) |
|
Thanks Doug :-) |
|
+1. Do you want to add the history manager and Completer in this PR or later ? |
|
:-( needs rebase. |
|
Rebased, added history and completion. However, there's now a noticeable pause before it creates each debugger prompt; I want to see if I can reduce this. |
|
@takluyver made a PR against your branch to remove the delay. It just create a new pt_app, and pt_cli and reuse it across prompt calls. |
|
I've cleaned it up with a separate class for the prompt_toolkit based debugging machinery, rather than conditional code to use it inside If we go for this approach, ipdb will probably need some changes to use |
Yeas, I was thinking about that too.
+1 for merging, should I wait then ? I also played with adding keybindings for ipdb, but it seem prompt_toolkit does not really like that, |
|
Keybindings that do things like move between frames? Anything that can produce output on stdout while the prompt is active needs to be run inside CLI.patch_stdout_context(). And I don't think it works on stderr, though it should be possible to patch that as well. Let's give @gotcha a chance to see this before we merge. |
Sure, or even actually execute the command with the prompt. Technically for 6.0 I'd like to refactor the prompt to get current location and frame, to get something slightly smarter than the current 'just' It would also be pretty neat to have a frame selector, where you can actually press up/down and enter to be dropped at a specific point. |
|
needs rebase BTW. |
It would, but before we get too far into building debugger UIs, we should look at what existing things like pudb already provide. Will rebase. |
Still need to hookup history and completion.
Or Old Style. Roll on, end of Python 2 support.
Also fix lookup of current namespace.
The prompt drawing delay is now invisible to human eye.
Fair enough. |
|
Do you want to merge, or leave @gotcha a few more days ? |
|
I think it's been long enough already. :-) |
Builds on @Carreau's #9481, with a fallback to the standard input-based machinery when we're in the kernel. I don't much like how I check what we're in, though.