effect icon indicating copy to clipboard operation
effect copied to clipboard

Terminal.readLine hangs when input stream is closed

Open cyberixae opened this issue 7 months ago • 0 comments

What is the problem this feature would solve?

In Unix based systems the user can press Ctrl+D to close the stdin pipe. Once the pipe is closed, providing any further input becomes impossible.

What is the feature you are proposing to solve the problem?

Effect Terminal.readLine needs an exception for the situation where user input is no longer available. In Unix systems it could be called EndOfFileException. However, DOS seems to support reading several files consecutively through the same input stream. Perhaps it could be called EndOfInputException to be more platform neutral.

What alternatives have you considered?

It might be possible to add a timeout for user input. However, that wouldn't be nearly as good as getting accurate information about the input stream status.

cyberixae avatar May 17 '25 10:05 cyberixae