GNU bug report logs - #25753
Python with libedit (macOS default) echoes input, breaks native completion

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Thu, 16 Feb 2017 16:09:02 UTC

Severity: normal

Merged with 21431, 22796, 26326

Found in versions 24.5, 25.1, 25.2, 26.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #68 received at 25753 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: 25753 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#25753: 25.2; Python mode shell interaction not working 100%
Date: Sun, 26 Feb 2017 21:14:45 -0500
charles <at> aurox.ch (Charles A. Roelli) writes:

> On Sat, Feb 25 2017 at 09:34:10 am, npostavs <at> users.sourceforge.net wrote:
>
>> Possibly setting `comint-process-echoes' could help, though I don't
>> understand why there is echoing in the first place.
>
> Thanks for the pointer to that variable.  I ran this:
>
>    (add-hook 'inferior-python-mode-hook (lambda () (setq comint-process-echoes t)))
>
> and the commands at the prompt stopped echoing, but the support
> functions still echoed.  So it looks like the problem has to be fixed on
> the readline/libedit side of Python.

This thread[1] might be somewhat relevant:

    The problem is that eshell tells subprocesses that they're running in
    a terminal (e.g., when queried via hIsTerminalDevice), but always
    echos user input itself regardless of the tty's ECHO attribute. This
    confuses libedit, which assumes that if it's connected to a terminal
    then it can turn off echoing in order to run its own rich line editor.

[1]: http://glasgow-haskell-users.haskell.narkive.com/vyeVJUEB/problem-with-echo-prompting-in-ghci-visible-in-emacs

>  So it would seem that `sudo easy_install
> gnureadline' is the right thing to run.  However that still does not fix
> the issue because python2.7/lib-dynload/ comes before
> python2.7/site-packages/ (where `gnureadline' is installed) in Python's
> $PATH equivalent, `sys.path'.  The solution, then, is to reorder the
> path somehow or get `readline.so' out of the way (maybe by renaming it
> -- cleaner suggestions welcome).

I guess renaming should have the least amount of side-effects.




This bug report was last modified 1 year and 270 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.