From 11df2b7719deda04d6a89921af8763c61f66b6a9 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 20 Sep 2019 20:43:36 +0200 Subject: [PATCH] enable compiling with readline for macOS which has a very simple readline header only --- src/frontend/signal_handler.c | 2 +- src/main.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/signal_handler.c b/src/frontend/signal_handler.c index 6a53c633f..c6a6d27b3 100644 --- a/src/frontend/signal_handler.c +++ b/src/frontend/signal_handler.c @@ -55,7 +55,7 @@ ft_sigintr_cleanup(void) /* sjb - what to do for editline??? The following are not supported in editline */ -#if defined(HAVE_GNUREADLINE) +#if defined(HAVE_GNUREADLINE) && !defined(__APPLE__) /* Clean up readline after catching signals */ /* One or all of these might be superfluous */ (void) rl_free_line_state(); diff --git a/src/main.c b/src/main.c index e2f7324f3..2e20bbe86 100644 --- a/src/main.c +++ b/src/main.c @@ -605,6 +605,8 @@ app_rl_readlines(void) rl_readline_name = application_name; rl_instream = cp_in; rl_outstream = cp_out; + +#ifndef __APPLE__ #ifndef X_DISPLAY_MISSING if (dispdev->Input == X11_Input) rl_event_hook = app_event_func; @@ -615,6 +617,7 @@ app_rl_readlines(void) This variable is not supported by editline. */ #if defined(HAVE_GNUREADLINE) rl_catch_sigwinch = 1; /* allow readline to respond to resized windows */ +#endif #endif /* note that we want some mechanism to detect ctrl-D and expand it to exit */