From 048c8abacbe3b923737f4eba039eb14af4bbf97a Mon Sep 17 00:00:00 2001 From: mqy Date: Sun, 19 Mar 2023 14:50:20 +0800 Subject: [PATCH] interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color reset. --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 105dd91ee..6f95a5d65 100644 --- a/main.cpp +++ b/main.cpp @@ -752,6 +752,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;