]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Windows: reactive sigint handler after each Ctrl-C (#736)
authormgroeber9110 <redacted>
Mon, 3 Apr 2023 16:00:55 +0000 (18:00 +0200)
committerGitHub <redacted>
Mon, 3 Apr 2023 16:00:55 +0000 (18:00 +0200)
examples/main/main.cpp

index 3130aef0c991b9695fa20274c1802acce713c0e7..453450a41d7d4544db8fbab3ada39ffabf4fa7a6 100644 (file)
@@ -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> ");
                 }