From: mgroeber9110 Date: Mon, 3 Apr 2023 16:00:55 +0000 (+0200) Subject: Windows: reactive sigint handler after each Ctrl-C (#736) X-Git-Tag: gguf-v0.4.0~1020 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=53dbba769537e894ead5c6913ab2fd3a4658b738;p=pkg%2Fggml%2Fsources%2Fllama.cpp Windows: reactive sigint handler after each Ctrl-C (#736) --- diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 3130aef0..453450a4 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> "); }