https://kotlinlang.org logo
#getting-started
Title
# getting-started
z

zt

02/07/2023, 6:52 AM
how can I start a bash shell then while making use of kotlin coroutines send commands to it and get the stdout?
e

ephemient

02/07/2023, 7:14 AM
on JVM? this isn't something that the underlying Java platform provides good APIs for
you could use
ProcessBuilder
and read/write its pipes, but a. that's blocking and b. it won't act like it's in a terminal
IntelliJ uses https://github.com/JetBrains/pty4j to wrap native code which is able to interact with terminal APIs
if you just want to run commands and get their output individually though, there's no need for any of that. just use a
ProcessBuilder
for each
z

zt

02/07/2023, 7:27 AM
I see, thank you