Accept input from stdin during interpretation
Opened this issue · 0 comments
Since 9b0584f eu.iamgio.pikt.compiler.AbstractCompiler
exposes the handleInput(stdin)
function that allows writing to the Kotlin compiler's stdin from Pikt's CLI.
The main implementation is handled by eu.iamgio.pikt.compiler.Interpreter
. It lets the user interact with the Kotlin script interpreter via Pikt's standard input.
A common scenario would be calling Pikt's readInput()
function (defined in the stdlib) and expecting some input from the command line.
The issue is that, on Pikt's side, the stream keeps looking for some new input and keeps the process alive, despite being in another thread. When it's fed with a line, the stream is already closed and leads to an IOException
.
The stdin is being temporarily locked again (the function call from AbstractCompiler
was commented out) until a solution is found. Any kind of help would be highly appreciated.