mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-12 08:10:07 +00:00
workaround for ZSH status behavior
`$pipestatus` is returning all zeros when using `[[ ]]` expressions that are false. This works around it by using `$status` (A.K.A. `$?`) when `$pipestatus` has only 1 items. Fixes #749
This commit is contained in:
parent
afb7387abe
commit
fe33c401ba
1 changed files with 7 additions and 2 deletions
|
@ -1163,8 +1163,13 @@ prompt_status() {
|
||||||
local ec
|
local ec
|
||||||
|
|
||||||
if [[ $POWERLEVEL9K_STATUS_SHOW_PIPESTATUS == true ]]; then
|
if [[ $POWERLEVEL9K_STATUS_SHOW_PIPESTATUS == true ]]; then
|
||||||
ec_text=$(exit_code_or_status "${RETVALS[1]}")
|
if (( $#RETVALS > 1 )); then
|
||||||
ec_sum=${RETVALS[1]}
|
ec_text=$(exit_code_or_status "${RETVALS[1]}")
|
||||||
|
ec_sum=${RETVALS[1]}
|
||||||
|
else
|
||||||
|
ec_text=$(exit_code_or_status "${RETVAL}")
|
||||||
|
ec_sum=${RETVAL}
|
||||||
|
fi
|
||||||
|
|
||||||
for ec in "${(@)RETVALS[2,-1]}"; do
|
for ec in "${(@)RETVALS[2,-1]}"; do
|
||||||
ec_text="${ec_text}|$(exit_code_or_status "$ec")"
|
ec_text="${ec_text}|$(exit_code_or_status "$ec")"
|
||||||
|
|
Loading…
Reference in a new issue