From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17651 invoked by alias); 2 Sep 2014 13:26:44 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33092 Received: (qmail 8878 invoked from network); 2 Sep 2014 13:26:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f156d0000063c7-9f-5405c58ce69c Date: Tue, 02 Sep 2014 14:26:35 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: stty not working Message-id: <20140902142635.25576e4c@pwslap01u.europe.root.pri> In-reply-to: <140901112837.ZM1866@torch.brasslantern.com> References: <140901012727.ZM1069@torch.brasslantern.com> <20140901111643.6e2acd9b@pwslap01u.europe.root.pri> <140901112837.ZM1866@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Zd2eo6whBusOWVocbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujFcfWQuucFS8fPKNuYHxGVsXIyeHhICJxLtr71kgbDGJC/fW A8W5OIQEljJKTO0/zw7hLGeS2PvgMSNIFYuAqsStZXvButkEDCWmbpoNFhcREJc4u/Y82CRh AVmJ9ukHweK8AvYS345fBItzClhKzHzwgRnEFhJ4xiixe1UsiM0voC9x9e8nJogr7CVmXjkD 1Sso8WPyPbBeZgEtic3bmlghbHmJzWveMk9gFJiFpGwWkrJZSMoWMDKvYhRNLU0uKE5KzzXU K07MLS7NS9dLzs/dxAgJwS87GBcfszrEKMDBqMTD+2Ihc4gQa2JZcWXuIUYJDmYlEV6Pvawh QrwpiZVVqUX58UWlOanFhxiZODilGhi1y3RO5dukhT959+PXPrmfvtmn9id5TFiz4e8Gv8Z3 iQll2V4alQ/Wam6OW9c2x/TExNnXFLUZNa8etZ44a/GqHdvfPF4260S4a7zYNc/bL3dc1Wlh iLTJMYw/EmD4+HkX85ziA/8O/7jyYH+D36s7ff+93p6/6qs/u+TrskYZ257XKswvIqVeKLEU ZyQaajEXFScCAEQc2gwfAgAA On Mon, 01 Sep 2014 11:28:37 -0700 Bart Schaefer 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