Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobs ignores -q for invalid PIDs #6809

Closed
soumya92 opened this issue Mar 26, 2020 · 0 comments · Fixed by #6812
Closed

jobs ignores -q for invalid PIDs #6809

soumya92 opened this issue Mar 26, 2020 · 0 comments · Fixed by #6812
Labels
bug Something that's not working as intended
Milestone

Comments

@soumya92
Copy link
Contributor

fish, version 3.0.2

In a script, I want to see whether a previous job is still running. I saw a "--quiet" flag, so I thought the following would work:

start-the-job &
set -l pid (jobs -lp)
# ... stuff ...
if jobs -q $pid
  echo "Job is still running"
end

But if the job has finished, this still prints jobs: No suitable job: 47362.

In fact, if the PID does not point to a fish job, there's no difference in the behaviour of jobs $badpid and jobs -q $badpid.

Is it reasonable to make the -q flag suppress that output as well? I've looked at the code and it doesn't seem like a huge change, but I'm not sure if there are reasons to not make this change.

@faho faho added the bug Something that's not working as intended label Mar 26, 2020
@faho faho added this to the fish 3.2.0 milestone Mar 26, 2020
@faho faho linked a pull request Mar 26, 2020 that will close this issue
3 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants