-
Notifications
You must be signed in to change notification settings - Fork 14
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
Strange (?) interaction with SIGINT, cargo run, and stdin #5
Comments
@birkenfeld Hmm, I'm not sure what's going on. Does |
I think this is basically expected behavior (unfortunately for now). What's happening is that the shell spawns a The shell, however, will realize that Cargo has exited, and then I believe it will close the stdio pipes set up for that program (notably stdin). I think this happens because the shell owned the Cargo process (e.g. it's managing it after spawning it), so that is the process which basically decides if the subtree "lives or dies". The two "fixes" for this that I know of are:
To me at least this doesn't look like a bug in chan-signal, so hope that helps! |
@alexcrichton Thanks so much for that detailed analysis! I buy it. :-) |
Thanks from me as well! |
Not sure this is a chan-signal issue or a cargo/std::process issue.
Given the following code:
it works fine when running the compiled binary on its own: loop happens, press Ctrl-C, prompt appears, line is read from stdin. When run with
cargo run
, reading the line fails withEIO
.The text was updated successfully, but these errors were encountered: