-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Debugging a readline app and CTRL+C makes the app stuck in a loop #64
Comments
This is probably because we set up a Can you check if removing the handler here fixes the issue? |
It doesn't but If I remove all handlers, it passes. I tried also to remove some handlers but it didn't help. |
Makes sense: I suppose we could create the registrations lazily when an event handler is added so that things work as expected in most cases. But if an event handler is added at any point or an app by some other means causes a |
I don't know but it is quite annoying to have such behavior. It makes |
I have hacked something like that at the end of the if (Debugger.IsAttached && !ctx.Cancel && context.Signal == PosixSignal.SIGINT)
{
Environment.Exit(-1073741510);
} Does it sound too hacky to add it? |
…are in the middle of a Read Fixes vezel-dev#64
Pushed a PR to let you see what are the changes to workaround this. |
…are in the middle of a Read Fixes vezel-dev#64
Hmm, it's admittedly been a while since I debugged anything in Visual Studio, but if my memory serves, pressing Ctrl-C in a console window while it's being debugged should be roughly equivalent to a debug break, no? Is exiting actually the expected behavior? |
D'oh! Actually I checked with a normal Console app or even without using Console at all and |
I think there's still an improvement to be made here though. We should only create those 4 |
Done in 29c4266. |
If you debug with Visual Studio the following program (with a CMD opened on Windows), and press CTRL+C, it won't exit:
It seems to be stuck in the following loop (it catches the CTRL+C but ignore it and continue)
https://github.com/alexrp/system-terminal/blob/adf2a455ea0dbc35f48d3204179324a7e37c0d82/src/core/Terminals/Windows/WindowsTerminalReader.cs#L57-L62
Running the app without debugging will properly exit the app.
Terminal: Compiled from latest master adf2a45
The text was updated successfully, but these errors were encountered: