aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/p10k.zsh12
-rw-r--r--internal/wizard.zsh7
2 files changed, 16 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 7c2037f5..cf0c7f21 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -6999,7 +6999,7 @@ function _p9k_reset_prompt() {
zle .reset-prompt
(( ${+functions[z4h]} )) || zle -R
} always {
- (( _p9k__can_hide_cursor )) && echoti cnorm
+ (( _p9k__can_hide_cursor )) && print -rn -- $_p9k__cnorm
_p9k__cursor_hidden=0
}
fi
@@ -7121,6 +7121,14 @@ _p9k_init_vars() {
typeset -gi _p9k__restore_prompt_fd
typeset -gi _p9k__redraw_fd
typeset -gi _p9k__can_hide_cursor=$(( $+terminfo[civis] && $+terminfo[cnorm] ))
+ if (( _p9k__can_hide_cursor )); then
+ # See https://github.com/romkatv/powerlevel10k/issues/1699
+ if [[ $terminfo[cnorm] == *$'\e[?25h'(|'\e'*) ]]; then
+ typeset -g _p9k__cnorm=$'\e[?25h'
+ else
+ typeset -g _p9k__cnorm=$terminfo[cnorm]
+ fi
+ fi
typeset -gi _p9k__cursor_hidden
typeset -gi _p9k__non_hermetic_expansion
typeset -g _p9k__time
@@ -7656,7 +7664,7 @@ function _p9k_on_widget_deactivate-region() { _p9k_check_visual_mode; }
function _p9k_on_widget_zle-line-init() {
(( _p9k__cursor_hidden )) || return 0
_p9k__cursor_hidden=0
- echoti cnorm
+ print -rn -- $_p9k__cnorm
}
function _p9k_on_widget_zle-line-finish() {
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 5d6215a7..2ffb606c 100644
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -222,7 +222,12 @@ function hide_cursor() {
}
function show_cursor() {
- echoti cnorm 2>/dev/null
+ local cnorm=${terminfo[cnorm]-}
+ if [[ $cnorm == *$'\e[?25h'(|'\e'*) ]]; then
+ print -n '\e[?25h'
+ else
+ print -n $cnorm
+ fi
}
function consume_input() {