-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
CancelKeyPress not firing on coreclr on ubuntu #16088
Comments
What build are you using? Can you share a minimal repro? |
Updated issue with more information. |
I'm on Ubuntu 14.04. I just tried your repro building coreclr/corefx from the latest sources and using corerun. I also tried downloading dotnet-cli from the tarball at https://github.com/dotnet/cli and using dotnet build. In both cases, it produced the expected output, printing out BBB and then exiting. @pallavit, are you able to repro this? @pakrym, just to make sure you're not accidentally ctrl-c'ing before you've actually gotten to the registration, can you add a Console.WriteLine after the CancelKeyPress registration so you know that it's actually completed? |
Added |
Updated to latest 1.0.0-dev-1452620519 dotnet, didn't help |
Spoke offline with @pakrym... turns out when building and then executing with In trying it out locally, it looks like this is an issue specific to how cc: @piotrpMSFT |
Forget |
SIGTERM would be handled by libuv right? If I recall, libuv does not flow back that event back. Unless you have a custom version of libuv, that might be it. |
@davidfowl it looks like we can receive SIGTERM via System.Console.CancelKeyPress. When we receive it we should pass it on from dotnet --> dotnet-run --> the app. @stephentoub is there an API to send Ctrl+C to a spawned process? |
Not unless some other code is registering for SIGTERM and sending another signal in its place. CancelKeyPress is for ConsoleSpecialKey.ControlC and ConsoleSpecialKey.ControlBreak, which are SIGINT and SIGQUIT, respectively. SIGTERM does not currently trigger a CancelKeyPress event.
Not exposed in the framework. On Unix it can be achieved via a P/Invoke to |
Code:
project.json:
Steps:
Coreclr output:
Mono output:
Environment:
Packages:
@muratg
The text was updated successfully, but these errors were encountered: