rust-ctrlc icon indicating copy to clipboard operation
rust-ctrlc copied to clipboard

Problem in win11 with powershell 7.4.1 (fine in command prompt)

Open fancellu opened this issue 1 year ago • 1 comments

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

fancellu avatar Feb 27 '24 21:02 fancellu

Sounds like a powershell problem to me if it works with older versions but does not work with recent ones.

Detegr avatar Mar 09 '24 22:03 Detegr