Looking for examples of tty / using subprocesses correctly in python #97
Replies: 3 comments 5 replies
-
Happy to add some docs/an example too once I get it, I do Developer Experience work for a living, so I write a lot of docs and such. |
Beta Was this translation helpful? Give feedback.
-
The tty allows you to run interactive terminal apps in a sunbeam extension (ex: an editor). It allows your script to gain control of the terminal (stdin/stdout and stderr are interactive). Example usage in python would be: test = subprocess.run(
["dbt", "test", "-s", node_name], stdin=subprocess.Pipe, stdout=subprocess.Pipe, stderr=subprocess.Pipe
) |
Beta Was this translation helpful? Give feedback.
-
I see. You will be able to see the logs, but they will be hidden as soon as the command exit. I'm still searching for a good way to handle this usecase. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
attempting to run a terminal command and ideally get an interactive/streaming response back, which my intuition says should be a 'tty' type command, but can't find any examples of the expected type to return in the JSON.
in the interim trying to do it with 'detail' type,
this works but i can't figure out how to introspect it and work from here. any tips on using the tty type? am i right about what it's for?
Beta Was this translation helpful? Give feedback.
All reactions