mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
agnoster: improve perf with use of $jobstates (zsh/parameter module)
This saves multiple fork/execs (for the subshell and wc) each time the prompt is rendered
This commit is contained in:
parent
e273cf004e
commit
015e6242aa
1 changed files with 2 additions and 1 deletions
|
|
@ -29,6 +29,7 @@
|
|||
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
||||
|
||||
CURRENT_BG='NONE'
|
||||
zmodload zsh/parameter
|
||||
|
||||
# Special Powerline characters
|
||||
|
||||
|
|
@ -207,7 +208,7 @@ prompt_status() {
|
|||
symbols=()
|
||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
|
||||
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
||||
[[ ${#jobstates} -ne 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
||||
|
||||
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue