From 03b96e379998962142774d7b58b94eadba0e77b3 Mon Sep 17 00:00:00 2001 From: piotrkochan Date: Sat, 27 Sep 2025 16:42:11 +0200 Subject: [PATCH 1/2] fix ncurses termination handling --- src/phmain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/phmain.c b/src/phmain.c index f336286a..61130459 100644 --- a/src/phmain.c +++ b/src/phmain.c @@ -100,9 +100,15 @@ extern uint64_t gpls_nbr; #ifdef HAVE_SIGACTION static struct sigaction action; static void sighup_hdlr(int sig); +#ifdef HAVE_NCURSES +extern int end_ncurses(void); +#endif static void sighup_hdlr(int sig) { +#ifdef HAVE_NCURSES + end_ncurses(); +#endif if(sig == SIGINT) log_critical("SIGINT detected! PhotoRec has been killed.\n"); else if(sig == SIGHUP) From 32f601d81e2136446a6336919a9c20d4f39ba20e Mon Sep 17 00:00:00 2001 From: piotrkochan Date: Mon, 29 Sep 2025 22:03:56 +0200 Subject: [PATCH 2/2] add end_ncurses to sighup_hdlr in testdisk.c --- src/testdisk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/testdisk.c b/src/testdisk.c index 78f5523b..52814ed8 100644 --- a/src/testdisk.c +++ b/src/testdisk.c @@ -79,6 +79,9 @@ static struct sigaction action; static void sighup_hdlr(int sig) { +#ifdef HAVE_NCURSES + end_ncurses(); +#endif if(sig == SIGINT) log_critical("SIGINT detected! PhotoRec has been killed.\n"); else if(sig == SIGHUP)