mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-25 13:30:07 +00:00
fix bugs in cpu_arch
This commit is contained in:
parent
9f0751c2e3
commit
edafcb5a7d
1 changed files with 13 additions and 7 deletions
|
@ -5656,10 +5656,16 @@ prompt_cpu_arch() {
|
||||||
state=$_p9k__cache_val[1]
|
state=$_p9k__cache_val[1]
|
||||||
text=$_p9k__cache_val[2]
|
text=$_p9k__cache_val[2]
|
||||||
else
|
else
|
||||||
text=$(command machine) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] ||
|
local cmd
|
||||||
text=$(command arch) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]] ||
|
for cmd in machine arch; do
|
||||||
text=
|
(( $+commands[$cmd] )) || continue
|
||||||
state=_${(U)text}
|
if text=$(command -- $cmd) 2>/dev/null && [[ $text == [a-zA-Z][a-zA-Z0-9_]# ]]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
text=
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
state=_${${(U)text}//İ/I}
|
||||||
_p9k_cache_ephemeral_set "$state" "$text"
|
_p9k_cache_ephemeral_set "$state" "$text"
|
||||||
fi
|
fi
|
||||||
if [[ -n $text ]]; then
|
if [[ -n $text ]]; then
|
||||||
|
@ -5669,8 +5675,8 @@ prompt_cpu_arch() {
|
||||||
(( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1]
|
(( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
_p9k_prompt_arch_init() {
|
_p9k_prompt_cpu_arch_init() {
|
||||||
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]'
|
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[machine]$commands[arch]'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with
|
# Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with
|
||||||
|
@ -8339,7 +8345,7 @@ _p9k_must_init() {
|
||||||
[[ $sig == $_p9k__param_sig ]] && return 1
|
[[ $sig == $_p9k__param_sig ]] && return 1
|
||||||
_p9k_deinit
|
_p9k_deinit
|
||||||
fi
|
fi
|
||||||
_p9k__param_pat=$'v138\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1'
|
_p9k__param_pat=$'v139\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1'
|
||||||
_p9k__param_pat+=$__p9k_force_term_shell_integration$'\1'
|
_p9k__param_pat+=$__p9k_force_term_shell_integration$'\1'
|
||||||
_p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1'
|
_p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1'
|
||||||
_p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1'
|
_p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1'
|
||||||
|
|
Loading…
Reference in a new issue