rust-ctrlc
rust-ctrlc copied to clipboard
Problem in win11 with powershell 7.4.1 (fine in command prompt)
Running 3.4.2
This code
fn exit() {
eprintln!("Exiting");
std::process::exit(0);
}
fn main() {
ctrlc::set_handler(exit).expect("Error setting Ctrl-C handler");
loop {
println!("Waiting for ctrl-c");
std::thread::sleep(std::time::Duration::from_secs(1));
}
}
works fine in command prompt, but inside powershell 7.4.1 it is ignored. powershell 5.1 is also fine!
https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4
Sounds like a powershell problem to me if it works with older versions but does not work with recent ones.