Not sure if the issue is that console is receiving Ctrl+C twice or if the issue is the way console is sending to the app the Ctrl+C signal.
With the test case attached, if you press Ctrl+C to break, you can see how the "Ctrl+C signal received" is printed twice.In Windows just one message is received.
In Windows you keep receiving the Ctrl+C signal continuosly just if you keep the C pressed. Could it be that we are sending the signals so so fast that one keypress is read as twice?
- Open cmd.exe and run CtrlHandler.exe
- Press Ctrl+C once
- The line "Ctrl+C signal received" appears twice.