Skip to content

Add an option to ignore Ctrl+C/SIGINT #159

@funmaker

Description

@funmaker

Hi. I have a script that spawns another program(probe-rs). That program handles Ctrl+C and prints out some useful information before exiting gracefully. When I press Ctrl+C in terminal(Windows), it seems that all 3 processes receive it(external program, my script and rust-script runner). I do handle it in my script using ctrlc in order to give time for probe to exit, but it seems rust-script exits and kills script and probe process immediately. However if I run the compiled script directly(from AppData) it works as expected. It would be nice if rust-script ignored Ctrl+C in order to let script handle it gracefully. Maybe when started with specific flag, but that might be a sane default option too since child programs exit on Ctrl+C anyway unless handled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions