Skip to content

Commit

Permalink
(per ggerganov#283) try to force flush of color reset in SIGINT handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bitRAKE committed Mar 19, 2023
1 parent 9a1d2c7 commit 77117c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ static bool is_interacting = false;
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) || defined (_WIN32)
void sigint_handler(int signo) {
printf(ANSI_COLOR_RESET);
printf("\n"); // this also force flush stdout.
if (signo == SIGINT) {
if (!is_interacting) {
is_interacting=true;
Expand Down

0 comments on commit 77117c7

Please sign in to comment.