From 084e2f0ec081c929343d44b09df07ae87cd1ed32 Mon Sep 17 00:00:00 2001 From: Qingyou Meng Date: Mon, 20 Mar 2023 02:10:00 +0800 Subject: [PATCH] interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color reset. (#283) --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 024b7e8..8e95c23 100644 --- a/main.cpp +++ b/main.cpp @@ -747,6 +747,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;