1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

fix old/new TTY detection

This commit is contained in:
Roman Perepelitsa 2020-10-31 07:10:11 +01:00
parent 76e5a69262
commit 5e2422df50

View file

@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() {
[[ -n $RPROMPT ]] || unset RPROMPT [[ -n $RPROMPT ]] || unset RPROMPT
} }
typeset -gri __p9k_instant_prompt_version=35 typeset -gri __p9k_instant_prompt_version=36
_p9k_dump_instant_prompt() { _p9k_dump_instant_prompt() {
local user=${(%):-%n} local user=${(%):-%n}
@ -5834,8 +5834,7 @@ _p9k_dump_instant_prompt() {
local tail=${content##*$rs$key$us} local tail=${content##*$rs$key$us}
[[ ${#tail} != ${#content} ]] || return [[ ${#tail} != ${#content} ]] || return
local P9K_PROMPT=instant local P9K_PROMPT=instant
if [[ $P9K_TTY != old || $_P9K_TTY != $TTY ]]; then if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then'
typeset -gx _P9K_TTY=$TTY'
if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then
>&$fd print -r -- ' typeset -gx P9K_TTY=new' >&$fd print -r -- ' typeset -gx P9K_TTY=new'
else else
@ -5850,6 +5849,7 @@ _p9k_dump_instant_prompt() {
fi' fi'
fi fi
>&$fd print -r -- ' fi >&$fd print -r -- ' fi
typeset -gx _P9K_TTY=$TTY
local -i _p9k__empty_line_i=3 _p9k__ruler_i=3 local -i _p9k__empty_line_i=3 _p9k__ruler_i=3
local -A _p9k_display_k=('${(j: :)${(@q)${(kv)_p9k_display_k}}}') local -A _p9k_display_k=('${(j: :)${(@q)${(kv)_p9k_display_k}}}')
local -a _p9k__display_v=('${(j: :)${(@q)display_v}}') local -a _p9k__display_v=('${(j: :)${(@q)display_v}}')
@ -6430,8 +6430,8 @@ function _p9k_on_expand() {
zle -F $_p9k__state_dump_fd _p9k_do_dump zle -F $_p9k__state_dump_fd _p9k_do_dump
fi fi
if (( ! $+P9K_TTY )) || [[ $_P9K_TTY != $TTY ]]; then if [[ -z $P9K_TTY || $P9K_TTY == old && -n ${_P9K_TTY:#$TTY} ]]; then
typeset -gx P9K_TTY=old _P9K_TTY=$TTY typeset -gx P9K_TTY=old
if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then if (( _POWERLEVEL9K_NEW_TTY_MAX_AGE_SECONDS < 0 )); then
P9K_TTY=new P9K_TTY=new
else else
@ -6443,6 +6443,8 @@ function _p9k_on_expand() {
fi fi
fi fi
typeset -gx _P9K_TTY=$TTY
__p9k_reset_state=1 __p9k_reset_state=1
if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE )); then if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE )); then