mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-13631: Fix the order of initialization for readline libedit on macOS. (GH-6915)
The editline emulation needs to be initialized *after* the name is defined. This fixes the long open issue.
This commit is contained in:
parent
64fddc423f
commit
c2f082e9d1
5 changed files with 23 additions and 8 deletions
|
@ -1078,6 +1078,9 @@ setup_readline(readlinestate *mod_state)
|
|||
Py_FatalError("not enough memory to save locale");
|
||||
#endif
|
||||
|
||||
/* The name must be defined before initialization */
|
||||
rl_readline_name = "python";
|
||||
|
||||
#ifdef __APPLE__
|
||||
/* the libedit readline emulation resets key bindings etc
|
||||
* when calling rl_initialize. So call it upfront
|
||||
|
@ -1099,7 +1102,6 @@ setup_readline(readlinestate *mod_state)
|
|||
|
||||
using_history();
|
||||
|
||||
rl_readline_name = "python";
|
||||
/* Force rebind of TAB to insert-tab */
|
||||
rl_bind_key('\t', rl_insert);
|
||||
/* Bind both ESC-TAB and ESC-ESC to the completion function */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue