From: Qingyou Meng Date: Sun, 19 Mar 2023 18:10:00 +0000 (+0800) Subject: interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color... X-Git-Tag: gguf-v0.4.0~1205 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=084e2f0ec081c929343d44b09df07ae87cd1ed32;p=pkg%2Fggml%2Fsources%2Fllama.cpp interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color reset. (#283) --- diff --git a/main.cpp b/main.cpp index 024b7e86..8e95c23d 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;