-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
Add SPACESHIP_JOBS_AMOUNT_THRESHOLD variable #486
Add SPACESHIP_JOBS_AMOUNT_THRESHOLD variable #486
Conversation
docs/Options.md
Outdated
@@ -523,6 +523,7 @@ This section show only when there are active jobs in the background. | |||
| `SPACESHIP_JOBS_SUFFIX` | ` ` | Suffix after the jobs indicator | | |||
| `SPACESHIP_JOBS_SYMBOL` | `✦` | Character to be shown when jobs are hiding | | |||
| `SPACESHIP_JOBS_COLOR` | `blue` | Color of background jobs section | | |||
| `SPACESHIP_JOBS_SHOW_AMOUNT_ALWAYS` | `false` | Show number of jobs (`true`, `false`) | |
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.
_SHOW_AMOUNT
with values of true | false | always
is more extensible and in line with other scripts, like you had in #459 :)
I like this idea better: https://github.com/denysdovhan/spaceship-prompt/pull/486/files#r204212086
sections/jobs.zsh
Outdated
@@ -13,6 +13,7 @@ SPACESHIP_JOBS_SYMBOL="${SPACESHIP_JOBS_SYMBOL="✦"}" | |||
SPACESHIP_JOBS_COLOR="${SPACESHIP_JOBS_COLOR="blue"}" | |||
SPACESHIP_JOBS_AMOUNT_PREFIX="${SPACESHIP_JOBS_AMOUNT_PREFIX=""}" | |||
SPACESHIP_JOBS_AMOUNT_SUFFIX="${SPACESHIP_JOBS_AMOUNT_SUFFIX=""}" | |||
SPACESHIP_JOBS_SHOW_AMOUNT_ALWAYS="${SPACESHIP_JOBS_SHOW_AMOUNT_ALWAYS=false}" |
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.
Instead of this how about using _THRESHOLD
variable for number of jobs after which count shows up ?
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 like this suggestion, although semantically only 0 and 1 would be the used thresholds, the code would be much more readable than figuring out what "SHOW=always" vs "SHOW=true" mean.
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.
May be SPACESHIP_JOBS_AMOUNT_THRESHOLD
for the variable name ?
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 a lot for the feedback, I've updated the commit
c71c405
to
0d1bfdd
Compare
docs/Options.md
Outdated
@@ -523,6 +523,7 @@ This section show only when there are active jobs in the background. | |||
| `SPACESHIP_JOBS_SUFFIX` | ` ` | Suffix after the jobs indicator | | |||
| `SPACESHIP_JOBS_SYMBOL` | `✦` | Character to be shown when jobs are hiding | | |||
| `SPACESHIP_JOBS_COLOR` | `blue` | Color of background jobs section | | |||
| `SPACESHIP_JOBS_AMOUNT_THRESHOLD` | `1` | Number of jobs which job section will be shown | |
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.
Wording isn't proper. jobs
section will be displayed if there are any background jobs, It's only the count we're hiding. May be something like "Number of jobs after which job count will be displayed/shown" ?
@maximbaz might be able to provide better options.
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 your suggestion is fine
0d1bfdd
to
15be173
Compare
Thank you for contributing @mimadrid 🎉 |
First of all, thanks a lot for this amazing project!
Description
I don't like the used jobs symbol and I prefer see the word 'jobs' (with the suffix variable) but the number of jobs isn't shown when there is only one.
I propose don't reset the $jobs_amount variable if the $SPACESHIP_JOBS_SHOW_AMOUNT_ALWAYS is yes
Config example:
Screenshot
I hope to be useful but perhaps another solution is better