Detegr / rust-ctrlc

Easy Ctrl-C handler for Rust projects
https://crates.io/crates/ctrlc
Other
599 stars 79 forks source link

Handling runs after the loop executes #79

Closed KanseiKy closed 1 year ago

KanseiKy commented 3 years ago

image As you can see, the above image show $ $ Keyboard intterupt. Use `exit` to exit What I expect it to be is something like

$ *ctrl+c*
Keyboard intterupt. Use `exit` to exit`
$

But that didn't happened. It runs the next iteration from my loop. Basically

prompt
wait for user input
ctrl+c
prompt
SIGINT handling
wait for user input

It should be

prompt
wait for user input
ctrl+c
SIGINT handling
prompt
wait for user input

(SIGINT handling and 2nd prompt supposed to swap places) I don't know if this is a bug or not but I can send more details if required

Detegr commented 3 years ago

Does this happen to you if you run cargo run --example readme_example?

Detegr commented 1 year ago

Closed as stale.