From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10146 invoked by alias); 13 Aug 2011 20:16:01 -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: 29678 Received: (qmail 955 invoked from network); 13 Aug 2011 20:16:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110813131553.ZM20724@torch.brasslantern.com> Date: Sat, 13 Aug 2011 13:15:53 -0700 In-reply-to: <110813115208.ZM20513@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: How to misplace an entire pipeline" (Aug 13, 11:52am) References: <110805203111.ZM32508@torch.brasslantern.com> <20110807185002.6a042cab@pws-pc.ntlworld.com> <110807144359.ZM27903@torch.brasslantern.com> <110807210507.ZM28821@torch.brasslantern.com> <20110808192720.380a3ee7@pws-pc.ntlworld.com> <110808231032.ZM2380@torch.brasslantern.com> <20110809211910.631d6561@pws-pc.ntlworld.com> <110813115208.ZM20513@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: How to misplace an entire pipeline MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Here's a not-new bug (occurs in, e.g., 4.2.0) that I found while trying to test the preceding patch for side-effects. torch% sleep 200 | sleep 300 | while :; do read '?GO:' < /dev/tty; done (rapid infinite loop printing "GO:" repeatedly) ^Z zsh: suspended sleep 200 | sleep 300 | zsh: running while :; do; read '?GO:' < /dev/tty; done torch% Note that it says the "while" loop is running, even though control has returned to the top-level prompt. If you bring this job back into the foreground, it now properly blocks on the "read": torch% fg [1] + continued sleep 200 | sleep 300 | while :; do; read '?GO:' < /dev/tty; done GO: Again, my patch didn't change this behavior, it's been this way for at least several revisions. It works somewhat better with "read -q". In 4.2.0, at the prompt printed by read, ^Z is silently ignored. Here is what happens with ^C instead: torch% sleep 200 | sleep 300 | while :; do read -q '?GO:' ; done GO: torch% jobs [1] running sleep 200 | sleep 300 torch% fg fg: no current job torch% %1 [1] + running sleep 200 | sleep 300 (These are now in the foreground.) With my patch from 29677, 4.3.12-dev-1 still silently ignores the ^Z, but now: torch% sleep 200 | sleep 300 | while :; do read -q '?GO:' ; done GO:% torch% [1] interrupt sleep 200 | sleep 300 torch% Which seems to make more sense.