From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#25753: 25.2; Python mode shell interaction not working 100% Date: Tue, 28 Feb 2017 11:34:12 +0100 Message-ID: References: <83lgt6xbr0.fsf@gnu.org> <87poifjsw2.fsf@users.sourceforge.net> <87poibgfyw.fsf@users.sourceforge.net> <87o9xtf0q6.fsf@users.sourceforge.net> <877f4efifx.fsf@users.sourceforge.net> <87innwe5wq.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488280148 32034 195.159.176.226 (28 Feb 2017 11:09:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 11:09:08 +0000 (UTC) Cc: 25753@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 28 12:09:03 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cifeP-0007VT-An for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 12:09:01 +0100 Original-Received: from localhost ([::1]:60214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cifeV-0007hA-Bj for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 06:09:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cif7a-0004WL-0h for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 05:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cif7W-0000cT-T9 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 05:35:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cif7W-0000cP-Pr for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 05:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cif7W-0000oT-EN for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 05:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2017 10:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25753 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25753-submit@debbugs.gnu.org id=B25753.14882780663079 (code B ref 25753); Tue, 28 Feb 2017 10:35:02 +0000 Original-Received: (at 25753) by debbugs.gnu.org; 28 Feb 2017 10:34:26 +0000 Original-Received: from localhost ([127.0.0.1]:59097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cif6v-0000na-To for submit@debbugs.gnu.org; Tue, 28 Feb 2017 05:34:26 -0500 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:53507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cif6u-0000nN-3v for 25753@debbugs.gnu.org; Tue, 28 Feb 2017 05:34:24 -0500 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id E748922380 for <25753@debbugs.gnu.org>; Tue, 28 Feb 2017 10:31:08 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-type:content-type:mime-version:message-id:in-reply-to :date:date:references:subject:subject:to:from:from; s=dkim; t= 1488277866; x=1489141867; bh=kAQ4KvcunXTnwySzJ87ae2CRkcXgxz18KbQ ixEW62Ew=; b=SD3vAzk6x0Ux7yypWTowhU/s5JaU3Wc23S2Kdks46y4m2D1TO4S Dz60vEGDg2fO1iDjn1vjypjHmxx/ao7/LgVpJiL2vbxgr4urp0dy6/0D/PhMAFF/ RUUhWk9xXBjWwbGdQWs5yx0sKGG5Al+a2BDT/34CIM9ybVEQj2f4mFvo= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OJyaFto82-zA for <25753@debbugs.gnu.org>; Tue, 28 Feb 2017 10:31:06 +0000 (UTC) Original-Received: from gray (54.4.4.85.dynamic.wline.res.cust.swisscom.ch [85.4.4.54]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id DCB462236B; Tue, 28 Feb 2017 10:31:04 +0000 (UTC) In-Reply-To: <87innwe5wq.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sun, 26 Feb 2017 21:14:45 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129939 Archived-At: On Sun, Feb 26 2017 at 09:14:45 pm, npostavs@users.sourceforge.net wrote: > charles@aurox.ch (Charles A. Roelli) writes: > >> On Sat, Feb 25 2017 at 09:34:10 am, npostavs@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 Thanks. FWIW, I tried this approach: > Given this info, there's a fairly easy emacs haskell-mode work-around. I > made a shell script "ghci-no-tty" in my ~/bin that contains > > # So ghci+readline won't echo input > cat | /usr/local/bin/ghci $* > > and used "M-x customize-group" with the "haskell" group to set the "Haskell > Program Name" variable to "/home/conal/bin/ghci-no-tty" (must be full path). > > Now there's no more input echoing, and commands like automatic signature > insertion ("\C-c\C-t") work again. using `python-shell-interpreter' and `cat | python $'. Python exited immediately with code 126, so I guess this solution does not work here. But I can't claim to understand any issues having to do with TTYs/"dumb terminals", so maybe I am missing something. >> 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. Great. This is what works for me: cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload mv readline.so readline.so.bak Hopefully we can add into emacs-25 a comment about this situation, advising Mac OS X users to install `gnureadline' with `easy_install gnureadline', then renaming `readline.so' to something not ending in `.so', if the native completion does not work immediately.