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 9494 invoked from network); 1 Oct 2021 00:05:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Oct 2021 00:05:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1633046725; b=Svc26zumGNXyTJ8TxjF+zXktXrmYzVLHjRYJXAdk5XF94xr4SJ7kyq3oaZzFKXvZBrcIN07pBP dw+ifjAynuIgxJztcjXJ2zoy/rMh9ECozJaxDM5XZgu9RmzqkxUoX8U34/U4VNWXUjt50Kv4g6 y0D7muamiwjtgMqkfGM6lpJt1Sf02B7jnmFP8kj3BfrA9LMekWIH2d9YjQkDu2ktiz2Ev2QZVr awFXTxzD0iaoVotRwiBVBMoG5JScbQX55J6rq0DazHou3D9pzXOiswUc4PyIRHVfOP4Vvj3ouC CeWSRehc21zghv+vsGyk2IH/bNne9gA3bkzIakq0LhpWmg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f41.google.com) smtp.remote-ip=209.85.166.41; 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=1633046725; bh=JriRaQOWZu7DszjRQRqEpx4+P3RLEF73P67o+0QH8Yw=; 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=g2pw5qVkXk7el0sEuwqf5e9rxonrNUPFGF8/2KUz0XFpuV1NnebJobwEOD7+AR+IfsQkIhInDv lMxEEuLv++0DYEq9fSGYrkq+3M6JJGgZqC1X1Tz4vmVyAdmI53nDfvZyFn0PvI5Bv9puNxRyqC we5hul/ETVq4yhdn5c2zRXrHGfvQL/ingPguHepPSpod5kvRqTMOmyIh5Oj1pbxVdofxKW/GG9 DJhBlJuorB7364zVgz0C9Xpft7k2lIbsNP953tAuv4rvZ2E3cpfAkr/sRjF2n42nDmGY1Gx2jD Vw/Wc65Ufk1sWD4P87TAHoLhPG6MKU6yBQy8MwCQOl78hA==; 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=pcObg5OZzTqCZFb71XJSSJnUA4z6W9peLHNjlkGylSc=; b=To5sfzD4obQnxcnqu9DxwUSSdf a2wkLfV4BhsaiaLv+nFqqNml9ek8ZWnaUBCVkKUfIf8er8770ySlxUjERY3U2UUGxtJligpua/chc lUBLIb34EWl68AA8WKhJgsqkQBO/nYFBivpZhkpj6b5UwtHzjg5Mn1cFI1xz9eU3Ct9hvdC1SyezW LOZm20J2rKDYPm1xyVVt9WpmkY5SSrYdHid3IBHMXICjG4KwGNlnu1x1UHTXWeaOiBNZl268OCWIX DjWeDTY4yHRpmLfvGlIn5crvp5lOB/eOiobGe71BhwFo/nw2tP52Y4PWwcWoaBm0EOoC3sj1LQdFU sD83dPkw==; Received: from authenticated user by zero.zsh.org with local id 1mW63H-0006jn-In; Fri, 01 Oct 2021 00:05:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f41.google.com) smtp.remote-ip=209.85.166.41; 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-f41.google.com ([209.85.166.41]:40621) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mW62i-00061i-57; Fri, 01 Oct 2021 00:04:49 +0000 Received: by mail-io1-f41.google.com with SMTP id r75so9707883iod.7 for ; Thu, 30 Sep 2021 17:04:47 -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=pcObg5OZzTqCZFb71XJSSJnUA4z6W9peLHNjlkGylSc=; b=M8DBSizX9HcavdfAmOFRA3DndmRqnf4DoZBw7hQAG+E+jh8DGdu3pjZKbARXV2tMU0 se3kWfa2FUdYzYUbUB+tKm0T21i2GRzUM3aW0p9qLSbDLPyXokd9c6ad6kJ0quh2WuOs Kph2ZDANknvG166qikjmw6Qoz3vyE9GNjGRPJKu1eZDrmlYwv6k/0r+6OVvGrdeqwy0q 6F0PwJ7vPTMGrOUIXWDk4+vTorN8ywup4UTzYwRZLF5GSfa7Z1ceW/cKwzP2qGu504MQ Xh6czfH0N0/MXMG+pESiO8zx5XsikdYqrDkHVGiR96gPl8PYmMZYzPPs3Arp1KpoksYl 1+/A== 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=pcObg5OZzTqCZFb71XJSSJnUA4z6W9peLHNjlkGylSc=; b=EQNO2TyfNOTPxdP1frwbzeyRupsedgFQ2uSeypTzvpbyxTwLdL3CVsjaxvg3dOkNx4 ZpGnPYLQzdDl4fGCRJy5dZfy8QrAm0RBvSZ/R5emXkStsbQZ9xp/ir2QadITOFmQa8Ik 5ZmaQUK2JIKc/S8QDYZCsA7Qm7CgBB67mipLSPaLRTKrjgXbXf0eZPu6B9Wcd312oxjc 4e3mCWKaA+hjkigPChXUyJjRjTqfMWNvmzvc/BAtKuNHblS3arAntrr9eZwvBwjy6aUE cM5mSkWelLjlV+YPRcGe3pn6ndywRWMoHP0ETel83nSipk70lnIWj2RvN/I4Jk8Inmuu ks0Q== X-Gm-Message-State: AOAM53150Z3VrCq+vKUc6yowFHsggq3+vDBGVYK7erA7G7L4PbJcSd5x vLmVGZgycMH8FFI78t8JZ72LCeb7/Gbv0spul3A= X-Google-Smtp-Source: ABdhPJzdFVNncuTuQKGzhPmXR7gbjl4PI8T1qnkP8BF12YlCSZnRYLg+8jlGj+M3Pwx0J5u7cqFJ8uMgc3VaILFDqBk= X-Received: by 2002:a05:6602:199:: with SMTP id m25mr5873065ioo.173.1633046686533; Thu, 30 Sep 2021 17:04:46 -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: <20210930234612.GA21179@gmx.de> From: Pier Paolo Grassi Date: Fri, 1 Oct 2021 02:04:11 +0200 Message-ID: Subject: Re: less with subprocess To: dominik.vogt@gmx.de, Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000a70cec05cd3f4f57" X-Seq: 27193 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: --000000000000a70cec05cd3f4f57 Content-Type: text/plain; charset="UTF-8" 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 > > --000000000000a70cec05cd3f4f57 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 cour= se the output is generated continuously=C2=A0and it is stored in ram by les= s, 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 d= o ctrl-c to dispose of the command even when find had not yet produced enou= gh output 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 Vincent, but I can only cheer for that solution for now)
I fai= l to understand how it would help me to create a tmpfs and make the long ru= nning 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 <dominik.vogt@gmx.de> ha scritto:
On Thu, Sep 30, 20= 21 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

--000000000000a70cec05cd3f4f57--