From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14416 invoked by alias); 21 Jul 2016 18:51:40 -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: 38909 Received: (qmail 4816 invoked from network); 21 Jul 2016 18:51:40 -0000 X-Qmail-Scanner-Diagnostics: from ioooi.vinc17.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(92.243.22.117):SA:0(-1.3/5.0):. Processed in 0.130106 secs); 21 Jul 2016 18:51:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: vincent@vinc17.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Thu, 21 Jul 2016 20:51:33 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: use of "less" in function and interrupt Message-ID: <20160721185133.GA11832@ioooi.vinc17.net> Mail-Followup-To: zsh-workers@zsh.org References: <20160720113633.GA17431@zira.vinc17.org> <20160720132113.1d70a4c0@pwslap01u.europe.root.pri> <160720204047.ZM27592@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <160720204047.ZM27592@torch.brasslantern.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.6.2-6740-vl-r90618 (2016-07-21) On 2016-07-20 20:40:47 -0700, Bart Schaefer wrote: > On Jul 20, 1:21pm, Peter Stephenson wrote: > } Subject: Re: use of "less" in function and interrupt > } > } On Wed, 20 Jul 2016 13:36:33 +0200 > } Vincent Lefevre wrote: > } > With zsh 5.2, if I type: > } > > } > zira% tless() { less "$@"; } > } > zira% sleep 5 | tless > } > > } > then "less" is left stopped in background after I type a key. > > After you type ^C, you mean? After I type ^C, I get the zsh prompt back, but "less" is not stopped yet. And if I type one or several other keys, "less" gets stopped. Something like that. > } Interestingly, I can get this to happen with > } > } sleep 5 | { less } > > In both cases it works as expected provided that "sleep 5" has exited, > so you have to interrupt the sleep. Yes, that's the goal of the sleep: to leave some time for the user to interrupt the command. In the reality for me, the sleep is actually some command that does some output (often not immediately) and the function is a wrapper to less. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)