add __p9k_initial_screen_empty for z4h integration

pull/1077/head
Roman Perepelitsa 4 years ago
parent 8f0db0c95a
commit 2ea3356d66

@ -5755,7 +5755,7 @@ _p9k_set_instant_prompt() {
[[ -n $RPROMPT ]] || unset RPROMPT
}
typeset -gri __p9k_instant_prompt_version=31
typeset -gri __p9k_instant_prompt_version=32
_p9k_dump_instant_prompt() {
local user=${(%):-%n}
@ -5800,6 +5800,7 @@ _p9k_dump_instant_prompt() {
local -i height=$_POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES
local prompt_dir=${(q)prompt_dir}"
>&$fd print -r -- '
(( __p9k_initial_screen_empty )) && height=0
local real_gitstatus_header
if [[ -r $gitstatus_dir/install.info ]]; then
IFS= read -r real_gitstatus_header <$gitstatus_dir/install.info || real_gitstatus_header=borked
@ -6052,7 +6053,11 @@ _p9k_dump_instant_prompt() {
exec 0<&$__p9k_fd_0 1>&$__p9k_fd_1 2>&$__p9k_fd_2 {__p9k_fd_0}>&- {__p9k_fd_1}>&- {__p9k_fd_2}>&-
unset __p9k_fd_0 __p9k_fd_1 __p9k_fd_2
typeset -gi __p9k_instant_prompt_erased=1
if (( __p9k_initial_screen_empty )); then
print -rn -- $'\''\033[2J'\''$terminfo[rc]${(%):-%b%k%f%s%u}
else
print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]
fi
if [[ -s $__p9k_instant_prompt_output ]]; then
command cat $__p9k_instant_prompt_output 2>/dev/null
if (( $1 )); then
@ -6246,7 +6251,11 @@ function _p9k_clear_instant_prompt() {
local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0))
local cr=$'\r'
local sp="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}"
if (( __p9k_initial_screen_empty )); then
print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u}
else
print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]
fi
local unexpected=${${${(S)content//$'\e[?'<->'c'}//$'\e['<->' q'}//$'\e'[^$'\a\e']#($'\a'|$'\e\\')}
if [[ -n $unexpected ]]; then
local omz1='[Oh My Zsh] Would you like to update? [Y/n]: '
@ -6306,8 +6315,12 @@ function _p9k_clear_instant_prompt() {
} 2>/dev/null
else
zf_rm -f -- $__p9k_instant_prompt_output 2>/dev/null
if (( __p9k_initial_screen_empty )); then
print -rn -- $'\e[2J'$terminfo[rc]${(%):-%b%k%f%s%u}
else
print -rn -- $terminfo[rc]${(%):-%b%k%f%s%u}$terminfo[ed]
fi
fi
prompt_opts=(percent subst sp cr)
if [[ $_POWERLEVEL9K_DISABLE_INSTANT_PROMPT == 0 && $__p9k_instant_prompt_active == 2 ]]; then
>&2 echo -E - ""

Loading…
Cancel
Save