zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: stty not working
Date: Tue, 02 Sep 2014 14:26:35 +0100	[thread overview]
Message-ID: <20140902142635.25576e4c@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <140901112837.ZM1866@torch.brasslantern.com>

On Mon, 01 Sep 2014 11:28:37 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> E.g., I might have expected that
> 
> % ttyctl -u; stty -echo; ttyctl -f
> 
> would "freeze" the terminal in no-echo mode, such that when accept-line
> is run and ZLE finishes, the terminal would be put into no-echo mode
> before the command is run.

It's very simple to add an option to ttyctl that saves the current state
of the terminal.  However, when we enter zle we call zsetterm() --- I
think typically in zrefresh() though the logic for setting up the
terminal seems a bit obscure --- which does...

    /* sanitize the tty */
    shttyinfo.tio.c_lflag |= ICANON | ECHO;

It's not entirely clear to me we should be doing that: the rest of
zsetterm() assigns shttyinfo to a local variable and then proceeds to
set up for line editing using operations on that, so they don't get
applied to the terminal settings used outside zle.  So maybe this ought
to do the same thing and we rely on the user knowing what they're doing
outside zle.

I haven't checked if this is the only gotcha.

pws


  parent reply	other threads:[~2014-09-02 13:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  2:38 Сергей Новиков
2014-09-01  8:27 ` Bart Schaefer
2014-09-01 10:16   ` Peter Stephenson
2014-09-01 18:28     ` Bart Schaefer
2014-09-02  8:47       ` Peter Stephenson
2014-09-02 13:26       ` Peter Stephenson [this message]
2014-09-02 15:52         ` Bart Schaefer
2014-09-02 16:04           ` Peter Stephenson
2014-09-03  1:32             ` Bart Schaefer
2014-09-01 10:02 ` Mikael Magnusson

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=20140902142635.25576e4c@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).