Skip to content

Commit

Permalink
Fix readline ignores Ctrl-C on macOS (#1347)
Browse files Browse the repository at this point in the history
- On macOS, you cannot cancel out of search ('/') using
  Ctrl-C (SIGINT), but rather must press <Enter> (and
  perform the search) to return to the main view.

- This commit partially reverts ea43f8b, “Fix segfaults
  with readline 8.0” (and associated Issue, “Piping to
  tig segfaults on exit” #893), but just for macOS builds.
  • Loading branch information
landonb committed Jul 17, 2024
1 parent 37ccb67 commit 89b9e6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 89b9e6f

Please sign in to comment.