aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-15 01:38:39 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-15 01:38:39 +0300
commitac04d7b952a3fad7f9b4f3ff2b9da64ad64181e2 (patch)
treec3582d5348a724b988ac4aada050a57aac6e7c9b
parent51def07661ebc01298af406cebdcd6b8934d710a (diff)
speed up background_jobs
-rwxr-xr-xpowerlevel9k.zsh-theme11
1 files changed, 5 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index d8f60622..16efa737 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -318,12 +318,11 @@ prompt_aws_eb_env() {
set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true
set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS false
prompt_background_jobs() {
- local n && n="${(fw)#$(jobs -d)}" && ((n > 1)) || return
- (( n /= 2 ))
-
- local prompt=''
- if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" &&
- ("$n" -gt 1 || "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS" == "true") ]]; then
+ local -i n=${(%)${:-%j}}
+ (( n )) || return
+ local prompt
+ if [[ $POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE == true &&
+ ($n -gt 1 || $POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE_ALWAYS == true) ]]; then
prompt=$n
fi
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$prompt" 'BACKGROUND_JOBS_ICON'