Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Strange behavior of $jobstates



[Moved from zsh-users]

On Mon, Nov 12, 2018 at 11:53 PM dana <dana@xxxxxxx> wrote:
>
> On 12 Nov 2018, at 22:46, Manabu Matsui <manabu.matsui@xxxxxxxxx> wrote:
> >I found a strange behavior of $jobstates. When I pipe the output of
> >echo $ jobstates,
> >its output is empty.
>
> The difference is the result of faf0035e53 (workers/42702). I guess anything
> that previously used information from the current (soon-to-be-parent) shell,
> like $jobstates and $sysparams[pid], would be affected that way.

Coming to this a bit late, but:

This seems inconsistent with the effort that we made way back in 2002
(workers/17265 and 17297) to be sure the "jobs" command works in
subshells.  If "jobs" works (which it still does), why shouldn't
$jobstates remain valid?

This is independent of other behavior on the left side of pipes, etc.,
such as the "echo ${a::=2}|cat" example later in the original thread.



Messages sorted by: Reverse Date, Date, Thread, Author