mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-28 11:23:03 +01:00
perf(agnoster): count background jobs with $jobstates
The job indicator ran `jobs -l | wc -l` in a command substitution on
every prompt. `${#jobstates}` gives the same count without forking a
pipeline, and still sees the parent's jobs inside the prompt's
command substitution.
Refs #14252
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa9ca00520
commit
54982410a9
1 file changed
+1
-1
@@ -338,7 +338,7 @@ prompt_status() {
|
||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_RETVAL_FG}%}✘"
|
||||
fi
|
||||
[[ $UID -eq 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_ROOT_FG}%}⚡"
|
||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙"
|
||||
(( ${#jobstates} )) && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙"
|
||||
|
||||
[[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" "$AGNOSTER_STATUS_FG" "$symbols"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user