summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-08-27 03:23:11 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-08-27 03:23:11 (GMT)
commitc427b8d517469005d53128e9656213a3ec141890 (patch)
tree9b24326e4ad8c154f6155574e2e157648a3c5777 /Modules/readline.c
parentcc9afa9b517fd66bad148f546055985ad87bc816 (diff)
downloadcpython-c427b8d517469005d53128e9656213a3ec141890.zip
cpython-c427b8d517469005d53128e9656213a3ec141890.tar.gz
cpython-c427b8d517469005d53128e9656213a3ec141890.tar.bz2
Issue #19884: Avoid spurious output on OS X with Gnu Readline
Also adjust the test condition, because enable-meta-key was only added in 6.1, not 6.0.
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 91f7cca..383b19a 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -1129,19 +1129,22 @@ setup_readline(readlinestate *mod_state)
mod_state->begidx = PyLong_FromLong(0L);
mod_state->endidx = PyLong_FromLong(0L);
-#ifndef __APPLE__
- if (!isatty(STDOUT_FILENO)) {
- /* Issue #19884: stdout is not a terminal. Disable meta modifier
- keys to not write the ANSI sequence "\033[1034h" into stdout. On
- terminals supporting 8 bit characters like TERM=xterm-256color
- (which is now the default Fedora since Fedora 18), the meta key is
- used to enable support of 8 bit characters (ANSI sequence
- "\033[1034h").
-
- With libedit, this call makes readline() crash. */
- rl_variable_bind ("enable-meta-key", "off");
- }
+#ifdef __APPLE__
+ if (!using_libedit_emulation)
#endif
+ {
+ if (!isatty(STDOUT_FILENO)) {
+ /* Issue #19884: stdout is not a terminal. Disable meta modifier
+ keys to not write the ANSI sequence "\033[1034h" into stdout. On
+ terminals supporting 8 bit characters like TERM=xterm-256color
+ (which is now the default Fedora since Fedora 18), the meta key is
+ used to enable support of 8 bit characters (ANSI sequence
+ "\033[1034h").
+
+ With libedit, this call makes readline() crash. */
+ rl_variable_bind ("enable-meta-key", "off");
+ }
+ }
/* Initialize (allows .inputrc to override)
*