don't trust cnorm as it's incorrect in some combinations of terminals and terminfo (#1699)

This commit is contained in:
Roman Perepelitsa 2022-07-21 13:54:51 +02:00
commit e72264e01c
2 changed files with 16 additions and 3 deletions

View file

@ -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() {