From e72264e01cb24431455ed6e398a769bca0da7ffe Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Thu, 21 Jul 2022 13:54:51 +0200 Subject: don't trust cnorm as it's incorrect in some combinations of terminals and terminfo (#1699) --- internal/wizard.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/wizard.zsh') 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() { -- cgit v1.2.3