Skip to content

Ipdb with prompt_toolkit#9487

Merged
Carreau merged 10 commits into
ipython:masterfrom
takluyver:ptk-ipdb
May 27, 2016
Merged

Ipdb with prompt_toolkit#9487
Carreau merged 10 commits into
ipython:masterfrom
takluyver:ptk-ipdb

Conversation

@takluyver

Copy link
Copy Markdown
Member

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.

@dsblank

dsblank commented May 20, 2016

Copy link
Copy Markdown
Contributor

This will be great, when done! (Just providing encouraging words of support :)

@takluyver

Copy link
Copy Markdown
Member Author

Thanks Doug :-)

@takluyver takluyver added this to the 5.0 milestone May 20, 2016
@Carreau

Carreau commented May 20, 2016

Copy link
Copy Markdown
Member

+1. Do you want to add the history manager and Completer in this PR or later ?
(or only for 6.0)

@Carreau

Carreau commented May 21, 2016

Copy link
Copy Markdown
Member

:-( needs rebase.

@takluyver

Copy link
Copy Markdown
Member Author

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.

@Carreau

Carreau commented May 22, 2016

Copy link
Copy Markdown
Member

@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.

@Carreau

Carreau commented May 22, 2016

Copy link
Copy Markdown
Member

takluyver#16

@takluyver

Copy link
Copy Markdown
Member Author

I've cleaned it up with a separate class for the prompt_toolkit based debugging machinery, rather than conditional code to use it inside IPython.core.

If we go for this approach, ipdb will probably need some changes to use IPython.terminal.debugger.TerminalPdb. Pinging @gotcha.

@Carreau

Carreau commented May 23, 2016

Copy link
Copy Markdown
Member

I've cleaned it up with a separate class for the prompt_toolkit based debugging machinery, rather than conditional code to use it inside IPython.core.

Yeas, I was thinking about that too.

If we go for this approach, ipdb will probably need some changes to use IPython.terminal.debugger.TerminalPdb. Pinging @gotcha.

+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,
I'll have to dig into that, but that can wait 6.0.

@takluyver

Copy link
Copy Markdown
Member Author

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.

@Carreau

Carreau commented May 26, 2016

Copy link
Copy Markdown
Member

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.

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' ipdb>

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.

@Carreau

Carreau commented May 26, 2016

Copy link
Copy Markdown
Member

needs rebase BTW.

@takluyver

Copy link
Copy Markdown
Member Author

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.

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.

@Carreau

Carreau commented May 27, 2016

Copy link
Copy Markdown
Member

It would, but before we get too far into building debugger UIs, we should look at what existing things like pudb already provide.

Fair enough.

@Carreau

Carreau commented May 27, 2016

Copy link
Copy Markdown
Member

Do you want to merge, or leave @gotcha a few more days ?

@takluyver

Copy link
Copy Markdown
Member Author

I think it's been long enough already. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants