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 9722 invoked from network); 1 Oct 2021 00:07:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Oct 2021 00:07:27 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1633046847; b=Ru2qo94NLGNZkod5+rdIslqk/4W4BdjDt872sMZdHB2E0/13ldZZKQ9vm5cwGIDVadPvXMJw5G 01l9xGyzEDrW5Xj7btnkBfx313uG334HUunHwAwnH4kaw2TSK4tgDbVhYHVSCXswndxBP9uwPp u+m31eTWYHEd2wBpgvIp8lodyq3H20k3FHAB4J0R2epbXnal/QXXXIU1xXnnnrm+iufVRSAkWT aSTAkUR4P2rOmqLAqWCJtQ6BbWFvmca7puWQuuaHsLyIRaYPA1yYSamC626DxHRqyeV0z2lVqH Hl4QzF89y+9RmIrqruyvHg157u0eYOQi7dnlhB2oF0fzxg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f53.google.com) smtp.remote-ip=209.85.166.53; 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=1633046847; bh=HzAQ2CMoYMxAweDFg+kJfjDBzUnRLF9nfKRVKjGbMcs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=jx6p//onKzWcIXp12Wjw3RGSA0k2JYF2iorV2poATaNaBcf6i+gFJw5k4OIWWvOZz5Owmphnem EUwV1HsLf2TkCp3pWN962eg+Dszhz+vdYlglLGQkvQIQM5LtDemqU5Fp74G5ERI4sfhhV6as2x PAd2LUlV/iO3fJ735uZwjBqLdNaPLsKcf6MavubgCFrK4Icx42o1RTKtfELLxYBn8xkrOz/cKe ilDG1bII7D2UKMyeZKkPjUMI2q6+lKblG8m6ny0VNSVpJG6zllmJwFcrATe6KBILTeVyY4lfmC gDRpsVYIWUccYhnPAxVjZo/5ZGEly/b3cJqEXBSSwliyOw==; 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:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=l7iu/V+YeCtDsa3N8i4kBml0Ij8tpqQWMLFOQp0ojUk=; b=kouuPXUiLiPqGCUvb6l06vxUr+ YNApINezU4DGbTRwGFASKN0oNpZ5/tvca9pytOdu24xHoF1AuMR7e2YdVOITxW6qLcnu8DGtSXmtA pZGB/oAYPbwPj0DVCYHDNvPfvlCG3E5gNTJqtdMXhZqfw11jJd+fms5InD6UB0i96HKqdOumA1CFn XGyvZPkXqNsojxEiYryuiuL0s0Rv9xmI4guiZW1BNRfSHe+/rhYjTfyA/+jn9YVVAYTiN4k3Pv5s0 XaaVmNofOnHTkztRWLrRF5VhhYuKuyG/J6wmDAGMWs3I8BhDAcGMM89ySljD2ReICPu3gsx4dDzpw AakP1mmw==; Received: from authenticated user by zero.zsh.org with local id 1mW65G-00081E-SM; Fri, 01 Oct 2021 00:07:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f53.google.com) smtp.remote-ip=209.85.166.53; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f53.google.com ([209.85.166.53]:35491) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mW64X-0007Ht-Ol; Fri, 01 Oct 2021 00:06:42 +0000 Received: by mail-io1-f53.google.com with SMTP id b78so9743988iof.2 for ; Thu, 30 Sep 2021 17:06:41 -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; bh=l7iu/V+YeCtDsa3N8i4kBml0Ij8tpqQWMLFOQp0ojUk=; b=mkDBZ2ho/ZCQOx9vWNvdSBJ5Gss2cMe93DeZMM/bDjC2V4dUfLWnsFmRQHF9sM4adO ZSWsP8mHeukeeuWdS+3Ww2KxKTXy1BNdaRN02Z4fkP9RPTX61y9GaEyLOVH/YomCdglm g4Zba6MGb25PlI1ZazUErraWr44DPQSz+VEj/tHzyfPPRbI9QUAFyVPbEkQpCqIvM8Ia Gi9lZhdVtBce5g1ZcpjoxNCPqXc4nxY/oUsn7Mv9gRRaC1elXUyQrAKZxSFwIpBUDfdT oijIA/75XODZrnEXsxTBUKf+n4Z/s2Wv+jjIZ+yzeb70I5WYIjwHBS1i3XW5q94JnfOj VEmg== 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; bh=l7iu/V+YeCtDsa3N8i4kBml0Ij8tpqQWMLFOQp0ojUk=; b=PguW3m5dImZpEdT+DB2QsCaezIRq3g23MwV4d7OWhc4LDck/RoKzSEY6/Ec5MTHk3Y hv2axivYIaHQHPoHGZpXmQuYi0XGwlwLrlFdxYuOO4HhJMAOVPbRfyBAr3l00oHF5Stv mTX9DVO45FcMTnb89zE0vCikSRFy7S6QXt504U551vFT2zJx1snfTyqMAJHbMfBsn4y7 xxVbdjMy49h4QlbdVNfcOjukiYMhpaPg4vUwqtA0Pl2803/zpEV4jH/WdU9RyOyApZ1e 9aVaubVjaCF9VCBLfgymEsZH61hx0HZmQ+QTVQsiiyxlvvrV1ikap3tD29c/eeU/+wlY 3+9Q== X-Gm-Message-State: AOAM530OwaLrR+U46YkfIYKKLsi4LKfFS62JGrdlvuYl6LiiS/SeRU2F LxGcHKSvySRzhQIobSRHIqNTurpb8vsdWbk/Jrw= X-Google-Smtp-Source: ABdhPJx6xi5rcoH2H7V8/sT2b6q4jnuY9+D2DCzvRUoL8eosqhATEie5oOy1ntsUJQQ/ptT/YjzJmIfToLOHEvuyDd4= X-Received: by 2002:a05:6638:59:: with SMTP id a25mr7393110jap.92.1633046800529; Thu, 30 Sep 2021 17:06:40 -0700 (PDT) MIME-Version: 1.0 References: <20210927233143.GA16620@gmx.de> <20210928185230.GA7495@gmx.de> <20210929130217.GB25513@cventin.lip.ens-lyon.fr> <20210930191706.GA1641202@zira.vinc17.org> <20210930194800.GA15560@gmx.de> <20210930234612.GA21179@gmx.de> In-Reply-To: From: Pier Paolo Grassi Date: Fri, 1 Oct 2021 02:06:05 +0200 Message-ID: Subject: Re: less with subprocess To: dominik.vogt@gmx.de, Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000727a9105cd3f5695" X-Seq: 27194 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: --000000000000727a9105cd3f5695 Content-Type: text/plain; charset="UTF-8" PS I really appreciated the bag of holding reference :) Pier Paolo Grassi Il giorno ven 1 ott 2021 alle ore 02:04 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > Hello, thanks for your insights, but I think you are kind of missing the > point: I am already happy with what > > less -f <(find ...) > > gives me in terms of ux. Of course the output is generated > continuously and it is stored in ram by less, having gigabytes of ram it > doesn't really matters how much output is produced. > The only upgrade I was looking for was to be able to do ctrl-c to dispose > of the command even when find had not yet produced enough output to make > less satisfied, the infamous one screenfull of text. > your solution to use ctrl-z is good enough for that, given that no other > solution seems possibile (except for the patch proposed by Vincent, but I > can only cheer for that solution for now) > I fail to understand how it would help me to create a tmpfs and make the > long running process write there instead of to a pipe. If the process > doesn't produce output it will still hang the shell, doesn't it? > > Pier Paolo Grassi > > > Il giorno ven 1 ott 2021 alle ore 01:49 Dominik Vogt > ha scritto: > >> On Thu, Sep 30, 2021 at 10:59:25PM +0200, Pier Paolo Grassi wrote: >> > writing on disk it can eat away all the space I have on my device and >> make >> > other processes that need that disk space to fail. Even if disk is cheap >> > doesn't mean it's always plentifully available >> >> If you don't want to consume disk space you could use a >> ramdisk/tmpfs for the temporary files. Less will gobble up memory >> anyway if it gets tons of input, unless you give it the -b or -B >> option.) >> >> On the other hand I wonder what kind of command would generate an >> awful lot of output quickly which can still be overlooked manually >> in less. I mean, if you're only interested in the first N lines >> or M bytes, you can pipe the command's output through "head -n N" >> or "head -c M". >> >> cat /dev/zero | head -c 1000000 LF >> >> (With the global alias from an earlier message.) >> >> -- >> >> So, what you really want is to put the producing command to sleep >> while less is in "view" mode and wake it up when going to "follow" >> mode? That somehow contradicts your initial request: >> >> >> I use it like this so I am able to use ctrl-c and +F inside less to >> move >> >> around in the output already received ... >> >> ... and receive the new input received in the meantime (with +F) >> ^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^ >> >> -- >> >> If you *don't* want to put the producing process to sleep, it >> sounds a bit like "the command shall keep running and buffer the >> output in a magical bag of holding while less is in 'view' mode". >> >> -- >> >> If you don't want the output on disk, the only options I see are >> >> * either do not generate new data in the meantime >> * or store it somewhere else (memory/ramdisk, other medium) >> >> Ciao >> >> Dominik ^_^ ^_^ >> >> -- >> >> Dominik Vogt >> >> --000000000000727a9105cd3f5695 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
PS I really appreciated the bag of holding reference :)
Pier Paolo Grassi


Il giorno ven 1 ott 2021 alle ore 02:04 Pier Paolo Grassi <= pierpaolog@gmail.com> ha scr= itto:
Hello, thanks for your insights, but I think you are kind of missi= ng the point: I am already happy with what

less -f <(= find ...)

gives me in terms of ux. Of course the o= utput is generated continuously=C2=A0and it is stored in ram by less, havin= g gigabytes of ram it doesn't really matters how much output is produce= d.
The only upgrade I was looking for was to be able to do ctrl-c= to dispose of the command even when find had not yet produced enough outpu= t to make less satisfied, the infamous=C2=A0one screenfull of text.
your solution to use ctrl-z is good enough for that, given that no other= solution seems=C2=A0possibile=C2=A0(except for the patch proposed by Vince= nt, but I can only cheer for that solution for now)
I fail to und= erstand how it would help me to create a tmpfs and make the long running pr= ocess write there instead of to a pipe. If the process doesn't produce = output it will still hang the shell, doesn't it?

Pier Paolo Grassi


Il giorno ven 1 ott 2021 alle ore 01:49 Dominik Vogt <<= a href=3D"mailto:dominik.vogt@gmx.de" target=3D"_blank">dominik.vogt@gmx.de= > ha scritto:
On Thu, Sep 30, 2021 at 10:59:25PM +0200, Pier Paolo Grassi wrote:
> writing on disk it can eat away all the space I have on my device and = make
> other processes that need that disk space to fail. Even if disk is che= ap
> doesn't mean it's always plentifully available

If you don't want to consume disk space you could use a
ramdisk/tmpfs for the temporary files.=C2=A0 Less will gobble up memory
anyway if it gets tons of input, unless you give it the -b or -B
option.)

On the other hand I wonder what kind of command would generate an
awful lot of output quickly which can still be overlooked manually
in less.=C2=A0 I mean, if you're only interested in the first N lines or M bytes, you can pipe the command's output through "head -n N&q= uot;
or "head -c M".

=C2=A0 cat /dev/zero | head -c 1000000 LF

(With the global alias from an earlier message.)

--

So, what you really want is to put the producing command to sleep
while less is in "view" mode and wake it up when going to "f= ollow"
mode?=C2=A0 That somehow contradicts your initial request:

>> I use it like this so I am able to use ctrl-c and +F inside less t= o move
>> around in the output already received ...
>> ... and receive the new input received in the meantime (with +F) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^^^^^^^=C2=A0 =C2=A0 =C2=A0^^^^^^^= ^^=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^^^^^^^^^^^^^^^

--

If you *don't* want to put the producing process to sleep, it
sounds a bit like "the command shall keep running and buffer the
output in a magical bag of holding while less is in 'view' mode&quo= t;.

--

If you don't want the output on disk, the only options I see are

=C2=A0* either do not generate new data in the meantime
=C2=A0* or store it somewhere else (memory/ramdisk, other medium)

Ciao

Dominik ^_^=C2=A0 ^_^

--

Dominik Vogt

--000000000000727a9105cd3f5695--