aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authormgroeber9110 <45620825+mgroeber9110@users.noreply.github.com>2023-04-03 18:00:55 +0200
committerGitHub <noreply@github.com>2023-04-03 18:00:55 +0200
commit53dbba769537e894ead5c6913ab2fd3a4658b738 (patch)
tree196333f97962f43f3cab1311800f7e85e49663fb /examples
parent437e77855a54e69c86fe03bc501f63d9a3fddb0e (diff)
Windows: reactive sigint handler after each Ctrl-C (#736)
Diffstat (limited to 'examples')
-rw-r--r--examples/main/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 3130aef..453450a 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> ");
}