Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92639cc

Browse files
committed
Issue #19884, readline: calling rl_variable_bind ("enable-meta-key", "off")
does crash on Mac OS X which uses libedit instead of readline.
1 parent 45cff66 commit 92639cc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/readline.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,15 +1020,19 @@ setup_readline(readlinestate *mod_state)
10201020
mod_state->begidx = PyLong_FromLong(0L);
10211021
mod_state->endidx = PyLong_FromLong(0L);
10221022

1023+
#ifndef __APPLE__
10231024
if (!isatty(STDOUT_FILENO)) {
10241025
/* Issue #19884: stdout is no a terminal. Disable meta modifier
10251026
keys to not write the ANSI sequence "\033[1034h" into stdout. On
10261027
terminals supporting 8 bit characters like TERM=xterm-256color
10271028
(which is now the default Fedora since Fedora 18), the meta key is
10281029
used to enable support of 8 bit characters (ANSI sequence
1029-
"\033[1034h"). */
1030+
"\033[1034h").
1031+
1032+
With libedit, this call makes readline() crash. */
10301033
rl_variable_bind ("enable-meta-key", "off");
10311034
}
1035+
#endif
10321036

10331037
/* Initialize (allows .inputrc to override)
10341038
*

0 commit comments

Comments
 (0)