From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10989 invoked from network); 29 Sep 2021 14:48:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Sep 2021 14:48:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1632926909; b=svxDv/RHVm57sWK/8mTvapXxCxwOui3njSZyUOwtrDiraTLEIZPgrrHfPFE92pv1B3Cz0MmoLk oUWN4/98YX5tFhn4n1bstDn5g/rRHk07uCU+3Lrp+AShwctYOButArdMTbBFtjxiThun2V3dO3 hSK6cFvaDvfgWUQfElFwkdhMx3KiWck12w4EP3y1ZYZrsEppsYyBCzh2vWKGNBS0/yBdg0Wz8+ gtm0slMRIrD0SeuiDP4zMNaELjHmPGKYAIrYLtWds6r+pr4ViEF8YYR9qENg6n4WPQHiPByges 0+GUODs+/0/qC/1f0Km178KC2FeO7MjIGiLNJoB/cChIBg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f172.google.com) smtp.remote-ip=209.85.166.172; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1632926909; bh=UJ5bQRP4pg/oL8NiAyc8CKDUDS/Ply5/169ljv2WdkY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=gIAHlSDGXKQ16rae2pxIbi82TbdDH4tyzK+GN28I5UHVXUud6ODf0Uz+3fltRPCjsOb2Lm0pqN aKZvjJOUdmm0vSd3UZ62RpAcnkHOoTELDCr/YU4TkD240689S6JbpWGYrIqCatrMdRVhc4P8QE 06FRdPD8mw5/0Tpafxs6gcA0HkT/polP5D6SV7Zm7oPlq4z1c9TUjUwzPtb2l5qHUrdxINXMUG zkQH2L6b3y6Fo5CW8yTJee+r7cPIHEsJrqaT+09yOoWBk9l18wEF9kh0SL45Lmd4/6XC2zdK1z AY7rrxt53dmS5VojpI4mEO1W/kVI4GwZ4/hKDiccaGBAtg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=LwaFEguN5uK8fQErqxgxhl5MpuitnK57tzo88Urec4A=; b=P8gptm+7rOHRRGH124Sv0feNLT R2PKc1/EXJLdUogcSN2L6ShjEs2AwWgYDa8or5VMbiLvKSOu9cp6qHgEW5ZhUOTZQ3SbiiLZgMx+f 5gPzSoLoDEF/cfnP6eD6c6uMUuDVK14jpaeXwUGvwNtDIr5wGOCfo77ynXW1CwbLVwtXyz1LZJor3 yhnX5z1BXAQfx0CYgXCGTW0RpmZM7FH1K/6IAv3tfBZJnQeEdwZ4KGqeQ4Io2sa98LX6W29z4jaId LnCJQJqilHRN8xpGw2LMgOWSboNpVrs3s1K5PJhyQHKvp1uHA069PTz7176dHY48h6Sk4dlqXyyrN H7E0yDxQ==; Received: from authenticated user by zero.zsh.org with local id 1mVasm-000GBQ-Pq; Wed, 29 Sep 2021 14:48:28 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f172.google.com) smtp.remote-ip=209.85.166.172; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f172.google.com ([209.85.166.172]:40875) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mVas2-000FTS-GJ; Wed, 29 Sep 2021 14:47:42 +0000 Received: by mail-il1-f172.google.com with SMTP id k13so3104585ilo.7 for ; Wed, 29 Sep 2021 07:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LwaFEguN5uK8fQErqxgxhl5MpuitnK57tzo88Urec4A=; b=HJ67SgkAvbBK/Vx4rI7Nbo/qTHADqL2Wl47MCEWdlyajFBQD+aqiynppPba5PQetPT Xi4W75sdf7+h5UGYK0ME5camJ+BFeA4b8+sevjne+p+DkIEie05+B4gCLSblhM6cnTKK vXv9mKlHarsTlPihVllypUOmtITb8B0H3o2gQfXgFFOg4Yf0Fyz/O7QuAy/r8baUjkwy jkSjqJ8v4/VflYbrLpou3S388D0vu9AiGvMQ5vO/JzBkrT3AUogbu+dcvOldq4B/V81F xrmHN+Hu9zXihhCbpo2rGnv5Dl+RoUwOk96e45Zrdiz8iq2PjKvNmZq6HSfFeubWpZkH 2E0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LwaFEguN5uK8fQErqxgxhl5MpuitnK57tzo88Urec4A=; b=Pqpapl/v/wqOd5TrZn0CDWPDv9jjRywNcQb3CzZQ4k50Zwnbd/VLpqCIWK+deH2Rky qtzrBVYujcZAE9FfAaL79LL35J/Mxkhnm1UQF2+ix6XCvH8yyB5x0U4pxiKaoGd1dxAJ EAc8/iRw2ZF3ZrLl+fw3qkUjU2ZbkmsMkDki3V3mqG5pgWV4p6lpYCBMx6sxwolG9jOZ kqUfv7tz38JsACiNz+0pEd+Ql6R8rwKZccrdZ4v/saqIL8O0k63jTgPljtb19JIv1o0g 3T1a54sDOtYGaNZstbkKD7k3gG/Ouvwmv956CLwQR8M6L+g32K8lzNZpsUm0qbDzotqj Bwyw== X-Gm-Message-State: AOAM531CJcszKvccVoI5kfsPTAKHaWBmHXs+Pmr2KB3uRlLyb0x/8C77 gt5I259GrDhyXN1kWBX+r3oJ0O9dV5TB6U+VAwmyeiEAZws= X-Google-Smtp-Source: ABdhPJyvqsvON0cCyfHdjuesXrlGct8hmzvkTQyzB6TQJxj1uZTv8JhK4sMOS0eXfKUE+D01yRrKjQ4gqhQjVSlT6Vw= X-Received: by 2002:a05:6e02:661:: with SMTP id l1mr58444ilt.122.1632926861282; Wed, 29 Sep 2021 07:47:41 -0700 (PDT) MIME-Version: 1.0 References: <20210927233143.GA16620@gmx.de> <20210928185230.GA7495@gmx.de> <20210929130217.GB25513@cventin.lip.ens-lyon.fr> In-Reply-To: From: Pier Paolo Grassi Date: Wed, 29 Sep 2021 16:47:04 +0200 Message-ID: Subject: Re: less with subprocess To: Bart Schaefer Cc: Zsh Users Content-Type: multipart/alternative; boundary="00000000000082d41c05cd236960" X-Seq: 27181 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --00000000000082d41c05cd236960 Content-Type: text/plain; charset="UTF-8" I tried: LF () { () { cat >|$1 &! less $1 ; kill $! } =(:) } find | LF unfortunately when hitting F then ctrl-c in less the find process is immediately killed Pier Paolo Grassi Il giorno mer 29 set 2021 alle ore 16:15 Bart Schaefer < schaefer@brasslantern.com> ha scritto: > On Wed, Sep 29, 2021 at 6:02 AM Vincent Lefevre > wrote: > > > > cventin% LF () { () { cat >$1 &! less $1 ; kill $! } =(:) } > > cventin% echo | LF > > (anon):kill: kill 27684 failed: no such process > > Yeah, if you use it with a process that produces very little output, > the kill will fail. But there's no point in using it in that case. > Redirect stderr of kill if this bothers you. > > > And > > > > cventin% (sleep 1; echo foo) | LF > > > > gives an empty file in "less" > > Yes, you have to hit "F" in less to reload / wait for the file > contents. I suppose "less +F" might be preferable. There are still > some signal handling issues with having a subshell on the left side of > the pipe, which might very well indicate that there is still a zsh (or > "less"?) bug with signal propagation. > > --00000000000082d41c05cd236960 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I tried:

LF () { () { cat >|$1= &! less $1 ; kill $! } =3D(:) }

find | LF

unfortunately= when hitting F then ctrl-c in less the find process is immediately=C2=A0ki= lled


Pier Paolo Grassi

=

Il giorno mer 29 set 2021 alle ore 16:15 Bart Schaefer <schaefer@brasslantern.com> ha scr= itto:
On Wed, Se= p 29, 2021 at 6:02 AM Vincent Lefevre <vincent@vinc17.net> wrote:
>
> cventin% LF () { () { cat >$1 &! less $1 ; kill $! } =3D(:) } > cventin% echo | LF
> (anon):kill: kill 27684 failed: no such process

Yeah, if you use it with a process that produces very little output,
the kill will fail.=C2=A0 But there's no point in using it in that case= .
Redirect stderr of kill if this bothers you.

> And
>
> cventin% (sleep 1; echo foo) | LF
>
> gives an empty file in "less"

Yes, you have to hit "F" in less to reload / wait for the file contents.=C2=A0 I suppose "less +F" might be preferable.=C2=A0 Th= ere are still
some signal handling issues with having a subshell on the left side of
the pipe, which might very well indicate that there is still a zsh (or
"less"?) bug with signal propagation.

--00000000000082d41c05cd236960--