all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Warsaw <barry@python.org>
To: Andreas Schwab <schwab@suse.de>
Cc: 28500@debbugs.gnu.org, Mike Kupfer <mkupfer@alum.berkeley.edu>
Subject: bug#28500: 25.3; shell mode starts echoing command
Date: Tue, 19 Sep 2017 20:19:40 -0400	[thread overview]
Message-ID: <5C993508-76A7-4A5D-A2B9-6146213B7935@python.org> (raw)
In-Reply-To: <mvmbmm66cae.fsf@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

On Sep 19, 2017, at 09:36, Andreas Schwab <schwab@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!


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-09-20  0:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 15:46 bug#28500: 25.3; shell mode starts echoing command Barry A. Warsaw
2017-09-19  0:45 ` Glenn Morris
2017-09-19  0:54 ` Nick Helm
2017-09-19  1:05 ` Mike Kupfer
2017-09-19  2:49   ` Barry Warsaw
2017-09-19  7:34   ` Andreas Schwab
2017-09-19 13:20     ` Barry Warsaw
2017-09-19 13:36       ` Andreas Schwab
2017-09-19 14:49         ` Barry Warsaw
2017-09-20  0:19         ` Barry Warsaw [this message]
2017-09-20  6:12           ` Eli Zaretskii
2017-09-20 13:39             ` Barry Warsaw
2017-09-20 13:49               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5C993508-76A7-4A5D-A2B9-6146213B7935@python.org \
    --to=barry@python.org \
    --cc=28500@debbugs.gnu.org \
    --cc=mkupfer@alum.berkeley.edu \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.