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:
Robby RussellandClaude Opus 5.5 committed 2026-11-27 14:31:48 -08:00
1 parent aa9ca00520
commit 54982410a9
1 file changed
+1 -1
+1 -1
View File
@@ -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"
}