Lele Gaifax added the comment: I addressed Martin's comments (thank you!) in https://github.com/lelit/cpython/commits/issue22228_2, removing pointless usage of a macro and avoiding usage of module's state to store the "next line index", keeping it in a plain static variable.
Let me know how it looks now. Martin Panter writes: > Python’s “readline” module currently has runtime detection of Editline vs > Gnu Readline. I am not sure if it is strictly needed, or just that it was > easier than build-time detection, as hinted in > <https://bugs.python.org/issue6877#msg92654>. It is confusing, because we > have other build-time detection of particular Readline features. Yes, it confused me too. Also, there is at least one spot in setup_readline() that seems wrong to me, because it does not consider if it's effectively using libedit: #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"); } #endif > Perhaps you may be able to try out Editline using my patch for Issue 13501, > but in my experience, the non-Apple patched Editline is too buggy to be > useful in Python for much more than experimentation. I will try to find some spare time to spend on this, but unfortunately I can not promise I'll be able to do that in the near future, sorry. > I would prefer to expose more of this at the Python level, but that seems > hard to do. Yeah, I know (I've been here nearly from the beginning ;-). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22228> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com