runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Bring back Console.CancelKeyPress

Open davidfowl opened this issue 11 years ago • 10 comments

We need this so that we can wait on Ctrl + C events in console applications. See https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNet.Hosting/Program.cs#L69.

davidfowl avatar Dec 20 '14 16:12 davidfowl

Yeah, this is strange omission.

davkean avatar Dec 20 '14 17:12 davkean

This depends on SetConsoleCtrlHandler which looks like it is available on the Windows platforms we are targeting. However @stephentoub do you know if we can implement this x-plat?

weshaggard avatar Dec 20 '14 18:12 weshaggard

We may be able to use signal(SIGINT, ...) for this on POSIX compliant platforms. More details are available at http://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html

pgavlin avatar Dec 20 '14 19:12 pgavlin

That's what mono uses in their implementation.

Tragetaschen avatar Dec 20 '14 20:12 Tragetaschen

Yeah, it should be doable.

stephentoub avatar Dec 20 '14 21:12 stephentoub

We've reviewed this proposal and think it's a good addition. However, we haven't marked it as accepting PRs because we want to port the existing code from the .NET Framework. We'll resolve this issue when we ported the code.

terrajobst avatar Jan 15 '15 23:01 terrajobst

Whats the state of this?

davidfowl avatar Mar 05 '15 11:03 davidfowl

Going to take care of this in the next few days.

ellismg avatar Mar 05 '15 18:03 ellismg

@ellismg - is this available now?

Praburaj avatar Mar 25 '15 21:03 Praburaj

Sorry, been busy with other stuff. Will try to get to this soon.

ellismg avatar Mar 25 '15 21:03 ellismg