Replies: 1 comment 5 replies
-
A subprocess would be the typical solution. No need to write a driver when you can launch a process and manage its stdin and stdout. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to expose a Textual
App
within an SSH terminal server I'm building. As such,stdin
andstdout
in the Python environment belong to the server, not the client connecting to the service; those are actuallyIO
objects (asyncioQueue
s under the hood, I believe).I've managed to get the client's
stdout
taken care of by way of a customDriver
implementation and overriddenwrite
andflush
methods, but I'm not seeing anything in there that would let me do the opposite for input (e.g.read
). Methods such as rich'sPrompt.ask
provide a way to accomplish this, so it would be wonderful if the same was true of Textual.Since this is a single-threaded, single-process asyncio server, monkey-patching
stdin
is not an option. That would not only break the server'sstdin
, but would also not work well when multiple clients are connected simultaneously with their own, individual sessions.Beta Was this translation helpful? Give feedback.
All reactions