cpython: b29edd0108ee (original) (raw)

Mercurial > cpython

changeset 100840:b29edd0108ee 3.5

Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric Price [#23735]

Martin Panter vadmium+py@gmail.com
date Sun, 03 Apr 2016 02:54:58 +0000
parents f5247195238f
children 41c2f8742bfe e3f375047edf
files Misc/ACKS Misc/NEWS Modules/readline.c configure configure.ac pyconfig.h.in
diffstat 6 files changed, 87 insertions(+), 0 deletions(-)[+] [-] Misc/ACKS 1 Misc/NEWS 3 Modules/readline.c 31 configure 44 configure.ac 5 pyconfig.h.in 3

line wrap: on

line diff

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -1155,6 +1155,7 @@ Florian Preinstorfer Amrit Prem Paul Prescod Donovan Preston +Eric Price Paul Price Iuliia Proskurnia Dorian Pula

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -99,6 +99,9 @@ Core and Builtins Library ------- +- Issue #23735: Handle terminal resizing with Readline 6.3+ by installing our

--- a/Modules/readline.c +++ b/Modules/readline.c @@ -928,6 +928,26 @@ on_completion_display_matches_hook(char #endif +#ifdef HAVE_RL_RESIZE_TERMINAL +static volatile sig_atomic_t sigwinch_received; +static sighandler_t sigwinch_ohandler; + +static void +readline_sigwinch_handler(int signum) +{

+ +#ifndef HAVE_SIGACTION

+#endif +} +#endif + /* C function to call the Python completer. */ static char * @@ -1033,6 +1053,10 @@ setup_readline(readlinestate mod_state) / Bind both ESC-TAB and ESC-ESC to the completion function */ rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); +#ifdef HAVE_RL_RESIZE_TERMINAL

+#endif /* Set our hook functions */ rl_startup_hook = on_startup_hook; #ifdef HAVE_RL_PRE_INPUT_HOOK @@ -1118,6 +1142,13 @@ readline_until_enter_or_signal(const cha struct timeval *timeoutp = NULL; if (PyOS_InputHook) timeoutp = &timeout; +#ifdef HAVE_RL_RESIZE_TERMINAL

+#endif FD_SET(fileno(rl_instream), &selectset); /* select resets selectset if no input was available */ has_input = select(fileno(rl_instream) + 1, &selectset,

--- a/configure +++ b/configure @@ -14929,6 +14929,50 @@ if test "x$ac_cv_lib_readline_rl_complet fi +# also in 4.0, but not in editline +{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -lreadline" >&5 +$as_echo_n "checking for rl_resize_terminal in -lreadline... " >&6; } +if ${ac_cv_lib_readline_rl_resize_terminal+:} false; then :

+LIBS=$ac_check_lib_save_LIBS +fi +{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_resize_terminal" >&5 +$as_echo "$ac_cv_lib_readline_rl_resize_terminal" >&6; } +if test "x$ac_cv_lib_readline_rl_resize_terminal" = xyes; then : + +$as_echo "#define HAVE_RL_RESIZE_TERMINAL 1" >>confdefs.h + +fi + +

check for readline 4.2

{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; }

--- a/configure.ac +++ b/configure.ac @@ -4527,6 +4527,11 @@ AC_CHECK_LIB(readline, rl_completion_dis AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1, [Define if you have readline 4.0]), ,$READLINE_LIBS) +# also in 4.0, but not in editline +AC_CHECK_LIB(readline, rl_resize_terminal, + AC_DEFINE(HAVE_RL_RESIZE_TERMINAL, 1,

+

check for readline 4.2

AC_CHECK_LIB(readline, rl_completion_matches, AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,

--- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -735,6 +735,9 @@ /* Define if you have readline 4.0 / #undef HAVE_RL_PRE_INPUT_HOOK +/ Define if you have readline 4.0 / +#undef HAVE_RL_RESIZE_TERMINAL + / Define to 1 if you have the `round' function. */ #undef HAVE_ROUND