From 9f867f58d9ed6a21831b664f1846c6a3ff66a122 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 7 Jul 2017 19:18:15 +0200 Subject: [PATCH] 11_terminal: Make axzsh_is_widechar_terminal() safer 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/11_terminal/11_terminal.zshrc b/core/11_terminal/11_terminal.zshrc index 0c7bce0..8697403 100644 --- a/core/11_terminal/11_terminal.zshrc +++ b/core/11_terminal/11_terminal.zshrc @@ -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 } -- 2.39.2