Skip to content
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

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

Open
fancellu opened this issue Feb 27, 2024 · 1 comment
Open

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

fancellu opened this issue Feb 27, 2024 · 1 comment

Comments

@fancellu
Copy link

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

@Detegr
Copy link
Owner

Detegr commented Mar 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants