From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20713 invoked by alias); 20 Feb 2012 18:53:35 -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: 30244 Received: (qmail 14305 invoked from network); 20 Feb 2012 18:53:34 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120220105301.ZM436@torch.brasslantern.com> Date: Mon, 20 Feb 2012 10:53:01 -0800 In-reply-to: <20120220183335.GE7797@xvii.vinc17.org> Comments: In reply to Vincent Lefevre "Re: suspend (^Z) behavior while a function is running is unclear" (Feb 20, 7:33pm) References: <20120220130259.GB7797@xvii.vinc17.org> <20120220151309.4cc1a83d@pwslap01u.europe.root.pri> <20120220160944.GC7797@xvii.vinc17.org> <20120220163557.672588e2@pwslap01u.europe.root.pri> <120220094100.ZM359@torch.brasslantern.com> <20120220183335.GE7797@xvii.vinc17.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: suspend (^Z) behavior while a function is running is unclear MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 20, 7:33pm, Vincent Lefevre wrote: } Subject: Re: suspend (^Z) behavior while a function is running is unclear } } > torch% foreach foo (a b c) { sleep 5 } | : } > zsh: job can't be suspended } } However if the command outputs something, one loses the output. I didn't really mean to imply that you should use this, just that some of the plumbing is in place if we wanted to provide direct control. On the other hand: foreach foo (a b c) { print $foo; sleep 5 } | while { read -rE } { : } (Using shortloops syntax to emphasize zsh-ness of this trick.) } But with the encapsulation (to save typing), this is very limited. As a hack, one could do: alias -g NOSUSP='|while { read -rE } { : }' foreach foo (a b c) { print $foo; sleep 5 } NOSUSP This is similar to the "alias -g M='|more'" trick that I know a number of people have used at one time or another.