GNU bug report logs - #28500
25.3; shell mode starts echoing command

Previous Next

Package: emacs;

Reported by: barry <at> python.org (Barry A. Warsaw)

Date: Mon, 18 Sep 2017 15:48:02 UTC

Severity: normal

Found in version 25.3

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

Bug is archived. No further changes may be made.

Full log


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

From: Barry Warsaw <barry <at> python.org>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 28500 <at> debbugs.gnu.org, Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Subject: Re: bug#28500: 25.3; shell mode starts echoing command
Date: Tue, 19 Sep 2017 20:19:40 -0400
[Message part 1 (text/plain, inline)]
On Sep 19, 2017, at 09:36, Andreas Schwab <schwab <at> suse.de> wrote:
> 
> $ stty; openssl aes-256-cbc -in foo.txt -out foo.text.enc; stty

What is happening is that -echo is getting lost.  `stty -echo` after exiting Python will restore normal behavior in a shell buffer.  I’m not entirely sure why, but this is neither set nor necessary in a Terminal window.

My suspicion now falls on readline from home-brew.  Specifically, if I build Python from git master but *remove* the readline.<blah>.so file so there’s no way that readline can be invoked, then I don’t see the problem.  readline gets imported implicitly if available when entering the interactive prompt, and I’ve proven to myself that if that happens, echo gets reenabled.  It’s the common feature with sqlite3 too, which for me comes from brew.  Further, because openssl comes from Apple, it isn’t linked with brew’s readline and that does *not* exhibit the problem.

And then I found this: https://github.com/Homebrew/brew/issues/651

I will follow up on that issue, but it’s clearly now not an Emacs bug.

FWIW, this little bit of Python in your $PYTHONSTARTUP file will workaround the problem:

import sys
import atexit
import termios

# Reset `stty -echo` on exit.
def no_echo():
    flags = termios.tcgetattr(sys.stdin)
    flags[3] &= ~termios.ECHO
    termios.tcsetattr(sys.stdin, termios.TCSADRAIN, flags)

atexit.register(no_echo)

Cheers!

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 7 years and 243 days ago.

Previous Next


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