-
Notifications
You must be signed in to change notification settings - Fork 726
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
Consideration for ANSI output over IPC / "next-gen" remote debugging #1204
Comments
Hi @goodboy, Much of this is possible already (much has been improved very recently in this area). We have If no Prompt_toolkit ships with helpers for SSH and Telnet servers. So, we can expose a prompt_toolkit application over an SSH or Telnet port. The SSH and Telnet helpers will ensure that new A beautiful example that exposes ptpython over both SSH and telnet, which embedding it in an application is this one: https://github.com/prompt-toolkit/ptpython/blob/master/examples/ssh-and-telnet-embed.py (Thank to @vxgmichel ). I haven't been using ptpdb recently, but it could be possible as well. Important here is that the application runs asynchronously, because we can't have nested event loops, and the SSH/Telnet server already spawns a loop. |
@jonathanslenders oh, this all looks great 🥳; I'm glad I asked! The RE: the ssh/telnet stuff I see that the async stuff is tied to The project I'm trying to support this in (a so called "structured concurrent actor system") is actually built on Some notes from me:
|
Hi @goodboy, I think we have to fix ptpdb, and make sure it uses prompt_toolkit 3.0. Then I guess you can use an asyncio adaptor to run it on trio. |
Since I've been mentioned, I though I'd drop by 😁
It seems like you're referring to a commit in prompt-toolkit 2.0, but prompt-toolkit 3.0 actually uses asyncio natively. That means prompt-toolkit 3.0 might just work with trio-asyncio, although I've never tried that. |
Ahh very gtk, thx @vxgmichel. I'm actually thinking though now it shouldn't matter too much since from our perspective we'll be running the debugger as a sync app and shouldn't care about how ptk is implemented underneath. The only concern is how to get output back to the appropriate parent process for relay to the local tty. The IPC part should be entirely out of thread of the debugged I'm thinking a background thread to do the output sending over IPC can be done as usual with I very much appreciate the tips! |
FYI: about ptpdb, I've been looking into upgrading this to prompt_toolkit 3.0. Unfortunately this is old code, that hasn't been maintained for a long time. I started the work in the following PR, but there's a lot to be done and I wonder whether it's worth the effort. I did underestimate that. Maybe, at some point I'll continue on this, but I can promise anything yet. |
@jonathanslenders well I'm glad you tried first 😄 before I got lost in it. Alternatively I know there was mention of |
Oh, I was also going to say another alternative might just be to use Though I guess this may mean hacking on |
Dug into
|
@goodboy : A |
Hey @jonathanslenders 😸
I was wondering what you thought about the idea of formalizing an API / configuration that would make it possible run
ptk
in a remote process and ship output over an IPC channel such that native remote debugging with things like coolio tab completion and syntax highlighting can be a thing; bringing the wonder of Python's interactivity to distributed systems dev.I've got a couple issue written up that cover my research up to this point:
As far as I gather
ptk
is pretty much the project (even outside python) capable of this feat and so I thought I'd start here :)I'll requote:
I'll re-summarize a few things we've discovered poking around these repos and which we've already listed in the above issues:
Would be greatly interested in what other things I've missed and any further input you might have.
Also I can add the explicit issue/repo links to that list if this issue is something you deem worth tracking.
Also a couple things wrt projects built on top of
ptk
(or wanting to support it):Also fwiw I have tried out
ptpdb
and I think it's super slick but, it might just be a bit too much as a default, with the full terminal UI and all (though having that kind of full UI glory is definitely nice to have if the user so chooses).One of the critical UX things I'm hoping for is the ability to work with a prompt while other asynchronous things are writing to the local tty and not having that prompt get clobbered. I pointed above to a couple things above but I'm hoping you can give me even more pointers on how to accomplish this 🕵️.
Look forward to your thoughts 🏄
The text was updated successfully, but these errors were encountered: