aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQingyou Meng <meng.qingyou@gmail.com>2023-03-20 02:10:00 +0800
committerGitHub <noreply@github.com>2023-03-19 20:10:00 +0200
commit084e2f0ec081c929343d44b09df07ae87cd1ed32 (patch)
tree395229946bde33cf918249d9e2de4d16b959a829
parent0b366e735729327476ec31da02de3c9c9771ddfb (diff)
interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color reset. (#283)
-rw-r--r--main.cpp1
1 files changed, 1 insertions, 0 deletions
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;