Skip to content

Commit

Permalink
Windows: reactive sigint handler after each Ctrl-C (ggerganov#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroeber9110 committed Apr 3, 2023
1 parent 437e778 commit 53dbba7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> ");
}
Expand Down

0 comments on commit 53dbba7

Please sign in to comment.