]> arthur.barton.de Git - ax-zsh.git/commitdiff
11_terminal: Make axzsh_is_widechar_terminal() safer
authorAlexander Barton <alex@barton.de>
Fri, 7 Jul 2017 17:18:15 +0000 (19:18 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 7 Jul 2017 17:18:15 +0000 (19:18 +0200)
Sometimes there were leftover artifacts of the escape sequence visible
in screen(1) and tmux(1), but not always. Anyways, with the splitted
echoing of the escape sequence, at least I wasn't able to reproduce it
any more, so hopefully this fixes the problem for everybody.

core/11_terminal/11_terminal.zshrc

index 0c7bce0a8bed651aa6d5dd0b6ec9cab9ae5eb838..86974038b9a8644ffb54160a98a1d3537470cdda 100644 (file)
@@ -26,9 +26,10 @@ alias isutfenv=axzsh_is_utf_terminal
 function axzsh_is_widechar_terminal {
        [[ -t 1 ]] || return 1
        axzsh_is_utf_terminal || return 1
-       echo -ne "🍀\033[6n\033[1K\r"
+       echo -ne "🍀\033[6n"
        read -s -d\[ garbage
        read -s -d R pos
+       echo -ne "\033[1K\r"
        [[ "${pos#*;}" -eq 2 ]] || return 1
        return 0
 }