zsh-workers
 help / color / mirror / code / Atom feed
* [Bug] $jobstates does not work in $()
@ 2022-03-01  0:46 Carl Agrell
  2022-03-01 10:40 ` Peter Stephenson
  0 siblings, 1 reply; 11+ messages in thread
From: Carl Agrell @ 2022-03-01  0:46 UTC (permalink / raw)
  To: zsh-workers

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)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-03-07 14:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01  0:46 [Bug] $jobstates does not work in $() Carl Agrell
2022-03-01 10:40 ` Peter Stephenson
2022-03-02  9:44   ` Daniel Shahaf
2022-03-02 20:18     ` Peter Stephenson
2022-03-03 22:04       ` Vin Shelton
2022-03-03 23:07         ` Bart Schaefer
2022-03-04  2:14           ` Jun T
2022-03-04 13:04             ` Daniel Shahaf
2022-03-04 13:13               ` Vin Shelton
2022-03-06  4:18               ` Jun T
2022-03-07 14:22                 ` Daniel Shahaf

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).