]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
interactive mode: print '\n' in sigint_handler, this flush stdout thus ensure color...
authorQingyou Meng <redacted>
Sun, 19 Mar 2023 18:10:00 +0000 (02:10 +0800)
committerGitHub <redacted>
Sun, 19 Mar 2023 18:10:00 +0000 (20:10 +0200)
main.cpp

index 024b7e86afe1621b01f99c618448270e6cb922ec..8e95c23d5d678fc0814fb7adeeeb00effb4c3a4e 100644 (file)
--- 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;