zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: John Hawkinson <jhawk@alum.mit.edu>, zsh-workers@zsh.org
Subject: Re: Anonymous functions don't show up well in "jobs" builtin output, except
Date: Tue, 25 Oct 2022 09:23:52 +0100 (BST)	[thread overview]
Message-ID: <1521379922.3637327.1666686232149@mail.virginmedia.com> (raw)
In-Reply-To: <Y1cIgQUOJZPzSS+x@louder-room.local>

> On 24/10/2022 22:49 John Hawkinson <jhawk@alum.mit.edu> wrote: I
> recently had a use-case where I needed to use an anonymous function
> shell one-liner to do some trickery with =() process substitution
> persisting for multiple commands (That is, () { thing1 $1; thing2 $1 }
> =(echo echo foo) ). I was surprised to find the resulting command was
> not meaningfully represented in the jobs builtin output.
>
> lrr% () { cat; }
> ^Z
> zsh: suspended

This is probably related to another continuing thread --- it's likely to
be because the anonymous function was originally running in the current
shell, and the entire shell was forked to continue running it in the
background.  This doesn't have the same job text a normal process would
have --- both a straight "cat" and "( cat )" are running as separate
processes from the start.

It's probably possible to do better but quite how hard it's going to be
dragging the job text round the houses I'm not sure.

pws


  reply	other threads:[~2022-10-25  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 21:49 John Hawkinson
2022-10-25  8:23 ` Peter Stephenson [this message]
     [not found]   ` <Y1ewKOKQJ1AnvR92@louder-room.local>
2022-10-25 10:05     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1521379922.3637327.1666686232149@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=jhawk@alum.mit.edu \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).