05nelsonm / kmp-process

Process implementation for Kotlin Multiplatform
Apache License 2.0
30 stars 1 forks source link

Add ability to write to `stdin` of a spawned process for `Native` & `Node.js` #77

Closed 05nelsonm closed 8 months ago

05nelsonm commented 8 months ago

Unsure how to square this circle, as the API for Node.js does not support synchronous writing to the stream.Writable.

Also, there are some write issues with Native that need attention.

For the time being, only Jvm has the ability to access standard input of a spawned process via Process.stdin extension function.

05nelsonm commented 8 months ago

So... for JS I think it may be possible to open our own pipe descriptors, pass the read end for stdin and then write synchronously. :thinking:

05nelsonm commented 8 months ago

So... for JS I think it may be possible to open our own pipe descriptors, pass the read end for stdin and then write synchronously. 🤔

Yeah, not gonna work. Looks like need to split async APIs out to blockingMain, then add the coroutines dependency 😒