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.114572 secs); 20 Jul 2016 11:46:56 -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: Wed, 20 Jul 2016 13:36:33 +0200
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: use of "less" in function and interrupt
Message-ID: <20160720113633.GA17431@zira.vinc17.org>
Mail-Followup-To: zsh-workers@zsh.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/1.6.2-6725-vl-r89564 (2016-07-16)
X-Seq: zsh-workers 38896

With zsh 5.2, if I type:

zira% sleep 5 | less

and Ctrl-C immediately after, this interrupts the "sleep 5" and
everything is fine ("less" ignores the SIGINT).

But if I use a function:

zira% tless() { less "$@"; }
zira% sleep 5 | tless

then "less" is left stopped in background after I type a key.

bash and mksh do not have this problem (Debian's ksh93 93u+20120801-2
is completely broken as "less" is immediately put in background).

-- 
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)

