aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-27 13:27:56 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-27 13:27:56 +0300
commit80770d6a792bf4967a4c4695dde84d07c46dc6a9 (patch)
tree3aa6e52fe8af66ef2c40f8401b8daea6da1d12b4 /internal
parentb66d6a71056b543aadc4249806e818002fd42813 (diff)
fix status on zsh 5.1
Diffstat (limited to 'internal')
-rwxr-xr-xinternal/p10k.zsh18
1 files changed, 10 insertions, 8 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index b4d0cb80..25acf8f2 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3149,7 +3149,8 @@ powerlevel9k_refresh_prompt_inplace() {
p9k_refresh_prompt_inplace() { powerlevel9k_refresh_prompt_inplace }
-typeset -ga __p9k_last_cmd_state
+typeset -gi __p9k_new_status
+typeset -ga __p9k_new_pipestatus
_p9k_save_status() {
emulate -L zsh && setopt no_hist_expand extended_glob
@@ -3172,8 +3173,8 @@ _p9k_save_status() {
# |
#
# We get status=1 and pipestatus=(1 0) and correctly ignore pipestatus.
- (( _p9k_status == __p9k_last_cmd_state[2] )) && return
- elif (( ${${__p9k_last_cmd_state[3,-1]}[(I)$__p9k_last_cmd_state[2]]} )); then # just in case
+ (( _p9k_status == __p9k_new_status )) && return
+ elif (( $__p9k_new_pipestatus[(I)$__p9k_new_status] )); then # just in case
local cmd=(${(z)_p9k_preexec_cmd})
if [[ $#cmd != 0 && $cmd[1] != '!' && ${(Q)cmd[1]} != coproc ]]; then
local arg
@@ -3188,16 +3189,17 @@ _p9k_save_status() {
done
fi
fi
- _p9k_status=$__p9k_last_cmd_state[2]
+ _p9k_status=$__p9k_new_status
if (( pipe )); then
- _p9k_pipestatus=($__p9k_last_cmd_state[3,-1])
+ _p9k_pipestatus=($__p9k_new_pipestatus)
else
- _p9k_pipestatus=($__p9k_last_cmd_state[2])
+ _p9k_pipestatus=($_p9k_status)
fi
}
_p9k_precmd() {
- __p9k_last_cmd_state=($EPOCHREALTIME $? $pipestatus)
+ __p9k_new_status=$?
+ __p9k_new_pipestatus=($pipestatus)
if (( $+_p9k_real_zle_rprompt_indent )); then
if [[ -n $_p9k_real_zle_rprompt_indent ]]; then
@@ -3214,7 +3216,7 @@ _p9k_precmd() {
prompt_opts=(cr percent sp subst)
setopt nopromptbang prompt{cr,percent,sp,subst}
- _p9k_timer_end=$__p9k_last_cmd_state[1]
+ _p9k_timer_end=EPOCHREALTIME
_p9k_save_status
powerlevel9k_refresh_prompt_inplace