Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[interactive] Fix Ctrl-C behavior in the OVM build.
Some #defines related to GNU readline weren't set in our frozen
pyconfig.h.

Fixes issue #225.
  • Loading branch information
Andy Chu committed Feb 8, 2019
1 parent db3b531 commit ca3af3c
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion Python-2.7.13/Modules/readline.c
Expand Up @@ -11,6 +11,39 @@
#include <errno.h>
#include <sys/time.h>

/* ------------------------------------------------------------------------- */

/* OVM_MAIN: This section copied from autotool-generated pyconfig.h.
* We're not detecting any of it in Oil's configure script. They are for
* ancient readline versions.
* */

/* Define if you have readline 2.1 */
#define HAVE_RL_CALLBACK 1

/* Define if you can turn off readline's signal handling. */
#define HAVE_RL_CATCH_SIGNAL 1

/* Define if you have readline 2.2 */
#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1

/* Define if you have readline 4.0 */
#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1

/* Define if you have readline 4.2 */
#define HAVE_RL_COMPLETION_MATCHES 1

/* Define if you have rl_completion_suppress_append */
#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1

/* Define if you have readline 4.0 */
#define HAVE_RL_PRE_INPUT_HOOK 1

/* Define if you have readline 4.0 */
#define HAVE_RL_RESIZE_TERMINAL 1

/* ------------------------------------------------------------------------- */

#if defined(HAVE_SETLOCALE)
/* GNU readline() mistakenly sets the LC_CTYPE locale.
* This is evil. Only the user or the app's main() should do this!
Expand Down Expand Up @@ -891,7 +924,7 @@ flex_complete(const char *text, int start, int end)
// Removed two #ifdefs because our frozen pyconfig.h doesn't have them. That
// is because I froze it inside Alpine Linux, which doesn't have readline.
//
// This fixes a bug where we would get extra spaces after completionS (only
// This fixes a bug where we would get extra spaces after completions (only
// detectable interactively).
//
// I'm not sure why the bug didn't show up until 0.6.pre11. It may have been
Expand Down

0 comments on commit ca3af3c

Please sign in to comment.