From 30ed065da1d1cf31b6969936e241f56f8bf7fc27 Mon Sep 17 00:00:00 2001 From: mgroeber9110 Date: Sun, 2 Apr 2023 22:04:44 +0200 Subject: [PATCH] Windows: reactive sigint handler after each Ctrl-C --- examples/main/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 3130aef0c..453450a41 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -368,6 +368,11 @@ int main(int argc, char ** argv) { // potentially set color to indicate we are taking user input set_console_color(con_st, CONSOLE_COLOR_USER_INPUT); +#if defined (_WIN32) + // Windows: must reactivate sigint handler after each signal + signal(SIGINT, sigint_handler); +#endif + if (params.instruct) { printf("\n> "); }