aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Suess <justin.suess@westpoint.edu>2023-03-15 15:39:38 -0400
committerGitHub <noreply@github.com>2023-03-15 21:39:38 +0200
commit16b2c61a22f828ea77d9f084ca871c63bc5cc283 (patch)
tree2319b938a5abca2d4d5f2c629458530e1ce20020
parent977295c700a2952c18400026d57467077dcd1a20 (diff)
fixed color reset on exit (#149)
* fixed color reset on exit * added sigint handler for ansi_color_reset * Update main.cpp --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
-rw-r--r--main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 6dc9ae9..6227db6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -755,6 +755,7 @@ static bool is_interacting = false;
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
void sigint_handler(int signo) {
+ printf(ANSI_COLOR_RESET);
if (signo == SIGINT) {
if (!is_interacting) {
is_interacting=true;
@@ -1052,5 +1053,9 @@ int main(int argc, char ** argv) {
ggml_free(model.ctx);
+ if (params.use_color) {
+ printf(ANSI_COLOR_RESET);
+ }
+
return 0;
}