diff options
author | Qingyou Meng <meng.qingyou@gmail.com> | 2023-03-20 02:10:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 20:10:00 +0200 |
commit | 084e2f0ec081c929343d44b09df07ae87cd1ed32 (patch) | |
tree | 395229946bde33cf918249d9e2de4d16b959a829 | |
parent | 0b366e735729327476ec31da02de3c9c9771ddfb (diff) |
interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color reset. (#283)
-rw-r--r-- | main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |