Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from ioooi.vinc17.net by f.primenet.com.au (envelope-from <vincent@vinc17.net>, 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 <vincent@vinc17.net>
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)
X-Seq: zsh-workers 38909

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 <vincent@vinc17.net> 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 <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

