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

work around bugs in terminals and window managers by essentially disabling prompt_sp (but keeping prompt_cr) in instant prompt for new TTYs

This commit is contained in:
Roman Perepelitsa 2021-08-28 10:14:37 +02:00
parent e362b69735
commit b3b0efb69f

View file

@ -5906,7 +5906,7 @@ _p9k_set_instant_prompt() {
[[ -n $RPROMPT ]] || unset RPROMPT [[ -n $RPROMPT ]] || unset RPROMPT
} }
typeset -gri __p9k_instant_prompt_version=41 typeset -gri __p9k_instant_prompt_version=42
_p9k_dump_instant_prompt() { _p9k_dump_instant_prompt() {
local user=${(%):-%n} local user=${(%):-%n}
@ -6172,12 +6172,14 @@ _p9k_dump_instant_prompt() {
fi fi
typeset -g _p9k__ret=$x typeset -g _p9k__ret=$x
} }
local out local out=${(%):-%b%k%f%s%u}
if [[ $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper ]] || (( ! $+_p9k__g )); then if [[ $P9K_TTY == old && ( $+VTE_VERSION == 0 && $TERM_PROGRAM != Hyper || $+_p9k__g == 0 ) ]]; then
local mark=${(e)PROMPT_EOL_MARK} local mark=${(e)PROMPT_EOL_MARK}
[[ $mark == "%B%S%#%s%b" ]] && _p9k__ret=1 || _p9k_prompt_length $mark [[ $mark == "%B%S%#%s%b" ]] && _p9k__ret=1 || _p9k_prompt_length $mark
local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0))
out+="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" out+="${(%):-$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}"
else
out+="${(%):-$cr%E}"
fi fi
if (( _z4h_can_save_restore_screen != 1 )); then if (( _z4h_can_save_restore_screen != 1 )); then
(( height )) && out+="${(pl.$height..$lf.)}$esc${height}A" (( height )) && out+="${(pl.$height..$lf.)}$esc${height}A"