diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-11-10 18:31:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-10 18:31:32 +0300 |
commit | 3b2d47febdf0c9b0b118e84cba458e4a698f30ba (patch) | |
tree | 010d869aeead830eda9799ec7fbd61c12c16535f | |
parent | eb2e1b0e96537f4b176b30ed74d623f979886dca (diff) | |
parent | 46fb03ed1982cfd3484d9309c66a086f29278557 (diff) |
Merge pull request #666 from ParthKolekar/patch-1
Allow showing the number of jobs even if there is <= 1 job present.
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | powerlevel9k.zsh-theme | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -187,6 +187,7 @@ your `~/.zshrc`: | Variable | Default Value | Description | |----------|---------------|-------------| |`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE`|`true`|If there is more than one background job, this segment will show the number of jobs. Set this to `false` to turn this feature off.| +`POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS`|`false`|Always show the jobs count (even if it's zero).| ##### battery diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index a8293358..caf2adbb 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -305,6 +305,7 @@ prompt_aws_eb_env() { # Segment to indicate background jobs with an icon. set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true +set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS false prompt_background_jobs() { local background_jobs_number=${$(jobs -l | wc -l)// /} local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'` @@ -313,7 +314,7 @@ prompt_background_jobs() { fi if [[ background_jobs_number -gt 0 ]]; then local background_jobs_number_print="" - if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && [[ "$background_jobs_number" -gt 1 ]]; then + if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && ([[ "$background_jobs_number" -gt 1 ]] || [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS" == "true" ]]); then background_jobs_number_print="$background_jobs_number" fi "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON' |