-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add empty ctrlc handler on Windows. #6002
Conversation
When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix. On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matklad (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR here! I think this is a good solution, and I learned something new about Windows ctrl-c handlers today! Could this perhaps just use
|
Oh also, could a test using |
I think you're probably right that |
Going to close this PR in favor PR #6004 which does the same thing but without the |
Add empty ctrlc handler on Windows. Fixes #6000. This is a 'better' version of PR #6002 that accomplishes the same thing using only `winapi` calls without the dependency on the `ctrlc` crate or spawning an additional thread. ---- When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix. On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.
Fixes #6000.
When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix.
On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.