Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept input from stdin during interpretation #3

Open
iamgio opened this issue Oct 28, 2022 · 0 comments
Open

Accept input from stdin during interpretation #3

iamgio opened this issue Oct 28, 2022 · 0 comments

Comments

@iamgio
Copy link
Owner

iamgio commented Oct 28, 2022

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.

issuedemo.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant