From 89b9e6f24bc4ef1e0091df2d991441b96a87f675 Mon Sep 17 00:00:00 2001 From: Landon Bouma Date: Wed, 17 Jul 2024 16:35:42 -0500 Subject: [PATCH] Fix readline ignores Ctrl-C on macOS (#1347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - On macOS, you cannot cancel out of search ('/') using Ctrl-C (SIGINT), but rather must press (and perform the search) to return to the main view. - This commit partially reverts ea43f8be, “Fix segfaults with readline 8.0” (and associated Issue, “Piping to tig segfaults on exit” #893), but just for macOS builds. --- src/prompt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/prompt.c b/src/prompt.c index 7463d46cb..2b803e0c7 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -475,8 +475,13 @@ readline_init(void) /* Let ncurses deal with the LINES and COLUMNS environment variables */ rl_change_environment = 0; rl_catch_sigwinch = 0; + /* Fix “Piping to tig segfaults on exit” (#893), + * except on macOS inhibits `readline()` Ctrl-C. + */ +#ifndef __APPLE__ rl_deprep_term_function = NULL; rl_prep_term_function = NULL; +#endif } static void sigint_absorb_handler(int sig) {