-
-
Notifications
You must be signed in to change notification settings - Fork 166
add +/- annotations to jobs builtin #2042
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
base: soil-staging
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I wonder if we can add a spec test like
$ bin/osh -c 'sleep 0.01 & sleep 0.02 & sleep 0.03 & jobs'
%1 3423 Running [subprog] command.Simple
%2 3424 Running [subprog] command.Simple
%3 3425 Running [subprog] command.Simple
(Although we really need to print code correctly)
...
I also noticed the pipeline case is a bit weird
we are not printing a job num
$ bin/osh -c 'sleep 0.1 | wc -l & jobs'
3440 Running [subprog] command.Simple
bash and zsh do
$ bash -c 'sleep 0.1 | wc -l & jobs'
[1]+ Running sleep 0.1 | wc -l &
core/process.py
Outdated
@@ -1777,9 +1777,17 @@ def DisplayJobs(self, style): | |||
# 24510 | sleep 5 & | |||
|
|||
f = mylib.Stdout() | |||
current, previous = self.GetCurrentAndPreviousJobs() | |||
for job_id, job in iteritems(self.jobs): | |||
# Use the %1 syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment can move to _DisplayJob()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
core/process.py
Outdated
for job_id, job in iteritems(self.jobs): | ||
# Use the %1 syntax | ||
job.DisplayJob(job_id, f, style) | ||
extra = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should default to one space so it's aligned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Nice catch
Let me see about adding a spec test |
Hm I think we should land this? Let me look at what happened |
A small quality of life improvement for job control. @andychu brought this up in https://oilshell.zulipchat.com/#narrow/stream/121540-oil-discuss/topic/Job.20control.20hard.20to.20understand