-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
docs: Clarify std::io::Stdin::read_to_string
behavior
#86613
Comments
I tested this in Docker on Linux with Rust 1.33 from Feb 2019, and got the same result.
|
This might be expected behavior on linux that is platform-specific, but I am not sure though. |
This works correctly on Linux/Unix. stdin only closes when pressing Ctrl+D and |
Hi all, so it appears this is working as expected (at least on linux). however, I personally think the docs should explain this a bit better. |
@rustbot label A-io T-libs |
std::io::Stdin::read_to_string
behavior
Is this fixed by #87820? |
yep, that resolves this issue |
Hi all,
I'm getting a weird stdin blocking issue. when reading from stdin, the console appears to freeze, nothing except what i type is written to the console. however, on windows, when the app is terminated the console buffer is "flushed", and all missing output is written, this doesnt seem to happen on linux (again, through ssh).
I originally encountered this issue on windows, but i was able to replicate it on linux with an (slightly) older toolchain (through ssh)
I will test beta, nightly, and a much older toolchain soon.
I tried this code:
I expected to see this happen: "type your input" logged, the message i typed, and after hitting enter, "got input {X}" being logged, and the program closing
Instead, this happened: *"type out input" is logged, my message appears as im writing, but hitting enter does not input the message, almost like it inserts a newline instead. after this, the program must be terminated with ctrl+c *
linux:
windows:
Meta
rustc --version --verbose
:Backtrace
lmk if i forgot anything and i'll update it asap
The text was updated successfully, but these errors were encountered: