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

[Bug] $jobstates does not work in $()



It appears that zsh/parameter's $jobstates is always empty inside $(),
probably because it's a subshell of some sort. `jobs` still works
however, making it rather incongruous. Having access to $jobstates
would be useful for prompts for example, rather than having to parse
the output of `jobs`.

To reproduce:
❯ sleep 1000 &
[1] 210460
❯ jobs
[1]  + running    sleep 1000
❯ echo $jobstates
running:+:210460=running
❯ echo $(jobs)
[1] + running sleep 1000
❯ echo $(echo $jobstates)
(empty)




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