Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Anonymous functions don't show up well in "jobs" builtin output, except
- X-seq: zsh-workers 50838
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: John Hawkinson <jhawk@xxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: Anonymous functions don't show up well in "jobs" builtin output, except
- Date: Tue, 25 Oct 2022 09:23:52 +0100 (BST)
- Archived-at: <https://zsh.org/workers/50838>
- Importance: Normal
- In-reply-to: <Y1cIgQUOJZPzSS+x@louder-room.local>
- List-id: <zsh-workers.zsh.org>
- References: <Y1cIgQUOJZPzSS+x@louder-room.local>
> On 24/10/2022 22:49 John Hawkinson <jhawk@xxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author