From: Carl Agrell <caagr98@gmail.com>
To: zsh-workers <zsh-workers@zsh.org>
Subject: [Bug] $jobstates does not work in $()
Date: Tue, 1 Mar 2022 01:46:05 +0100 [thread overview]
Message-ID: <CALd=4svJDyZFBFwqWjW=exP9bxmUdNaepz3Tk7aRrHxhYUPx8A@mail.gmail.com> (raw)
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)
next reply other threads:[~2022-03-01 0:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 0:46 Carl Agrell [this message]
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
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='CALd=4svJDyZFBFwqWjW=exP9bxmUdNaepz3Tk7aRrHxhYUPx8A@mail.gmail.com' \
--to=caagr98@gmail.com \
--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).