When die-ing bring cursor back to zero column explicitly since it could happen in raw mode

This commit is contained in:
Kovid Goyal 2022-02-27 20:53:41 +05:30
parent 95da414511
commit 0e2125cda3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -7,7 +7,7 @@ cleanup_on_bootstrap_exit() {
[ ! -z "$saved_tty_settings" ] && command stty "$saved_tty_settings" [ ! -z "$saved_tty_settings" ] && command stty "$saved_tty_settings"
} }
die() { printf "\033[31m%s\033[m\n" "$*" > /dev/stderr; cleanup_on_bootstrap_exit; exit 1; } die() { printf "\033[31m%s\033[m\n\r" "$*" > /dev/stderr; cleanup_on_bootstrap_exit; exit 1; }
dsc_to_kitty() { printf "\033P@kitty-$1|%s\033\\" "$(printf "%s" "$2" | base64 | tr -d \\n)" > /dev/tty; } dsc_to_kitty() { printf "\033P@kitty-$1|%s\033\\" "$(printf "%s" "$2" | base64 | tr -d \\n)" > /dev/tty; }
debug() { dsc_to_kitty "print" "debug $1"; } debug() { dsc_to_kitty "print" "debug $1"; }
echo_via_kitty() { dsc_to_kitty "echo" "$1"; } echo_via_kitty() { dsc_to_kitty "echo" "$1"; }