From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19611 invoked from network); 18 Jan 2008 17:39:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Jan 2008 17:39:35 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 34718 invoked from network); 18 Jan 2008 17:39:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Jan 2008 17:39:27 -0000 Received: (qmail 11194 invoked by alias); 18 Jan 2008 17:39:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24409 Received: (qmail 11182 invoked from network); 18 Jan 2008 17:39:23 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 Jan 2008 17:39:23 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id CD54B835D8A1 for ; Fri, 18 Jan 2008 18:39:15 +0100 (CET) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Fri, 18 Jan 2008 18:39:15 +0100 (CET) Received: from torch.brasslantern.com ([71.121.18.67]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JUU00ASLP117CK2@vms048.mailsrvcs.net> for zsh-workers@sunsite.dk; Fri, 18 Jan 2008 11:39:02 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m0IHd0jf015336 for ; Fri, 18 Jan 2008 09:39:01 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m0IHcxLC015335 for zsh-workers@sunsite.dk; Fri, 18 Jan 2008 09:38:59 -0800 Date: Fri, 18 Jan 2008 09:38:59 -0800 From: Bart Schaefer Subject: Misbehavior of "read" or ...? In-reply-to: <691a5d910801180119p32d48643wa55fd2aefaa3bf6a@mail.gmail.com> To: zsh-workers@sunsite.dk Message-id: <080118093859.ZM15334@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20080104105900.37a87f7e@news01> <237967ef0801040304h494987bv939bf6ff9541123f@mail.gmail.com> <477E177A.3060303@kotiportti.fi> <080113000048.ZM15017@torch.brasslantern.com> <20080116131048.GC16058@spiegl.de> <080116075915.ZM12209@torch.brasslantern.com> <20080116171253.GF16058@spiegl.de> <080116191103.ZM12889@torch.brasslantern.com> <20080117172603.GA664@spiegl.de> <691a5d910801180119p32d48643wa55fd2aefaa3bf6a@mail.gmail.com> Comments: In reply to "Bart Schaefer" "Re: idea for new feature (was: Re: sticky-note and zle bindings)" (Jan 18, 1:19am) X-Virus-Scanned: ClamAV using ClamSMTP On Jan 18, 1:19am, Bart Schaefer wrote to zsh-users: } } function xterm-ask { } local esc } unset REPLY reply } 1=get_${1#get_} } xterm-tell $1 } case $1 in } (get_(label|title)) } read -t 2 -rk 3 esc || return 1 } read -rsd $'\e' } read -rk 1 esc } ;; } (get_*) } read -t 2 -rk 2 esc || return 1 } IFS=';' read -Arsd t } (( $#reply > 2 )) && shift reply } ;; } esac } return 0 } } The above works flawlessly in 4.2.6, but in 4.3.4-dev-7 I can't seem to stop it from echoing the terminal's response in a way that the user can see it. Even wrapping the whole thing in "stty -echo" doesn't help. If I run xterm-tell get_position; IFS=';' read -Arsd t from the command line, it works as expected. It's only when running it in a shell function that it misbehaves. I've tried changing from "-rk" to "-rsk" in each place it's used; doesn't seem to matter. I've also redirected the output of "case ... esac" to /dev/null with no better result. The response IS getting seen by "read": schaefer<524> xterm-ask get_position ^[[3;1016;546t% schaefer<525> print $reply 1016 546 schaefer<526> unset reply schaefer<527> xterm-tell get_position; IFS=';' read -Arsd t schaefer<528> print $reply 1016 546 If I "set -x" the output appears immediately after the trace prints that "read" is going to be executed, so *something* that "read" is doing is causing the output to be echoed, I think: : xterm-ask:5:case; case get_iconify (get_*) : xterm-ask:9:case; read -t 2 -rsk 2 esc ^[[1t^[[1t: xterm-ask:10:case; IFS=';' : xterm-ask:10:case; read -Arsd t : xterm-ask:11:case; (( 1 > 2 )) : xterm-ask:13; return 0 I've tried removing the -t 2, skipping the "read -rk", etc. No change. This is really annoying.