From aa0467475d578553bafc68891734346bf183ca9b Mon Sep 17 00:00:00 2001 From: retoor Date: Fri, 21 Mar 2025 02:27:11 +0000 Subject: [PATCH] chore: clear terminal on first SIGINT before printing exit prompt in main.c Add explicit system("clear") call and newline in handle_sigint to visually reset the terminal display before showing the double-Ctrl+C exit message, ensuring clean output regardless of prior screen state. --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 646d36f..5a6d581 100644 --- a/main.c +++ b/main.c @@ -315,7 +315,9 @@ void init() { void handle_sigint(int sig) { time_t current_time = time(NULL); - + int ret = system("clear"); + (void)ret; + printf("\n"); if (sigint_count == 0) { first_sigint_time = current_time; sigint_count++;