Using the default two line prompt with the skull-emoji. Problem is that zsh counts the length of the prompt for tab completion and the UTF characters mess with that counting. All UTF characters need to be wrapped in %{%G<UTC character%}.
(e.g. write echo and then press TAB twice and observe how the prompt will get messed up.)
This fixes it (note the two UTF8 characters following the 'n'):
sed -i 's/\(\s*PROMPT=.*\)n└─\(.*\)/\1n%{%G└%}%{%G─%}\2/g' ~/.zshrc
I think this is actually a ZSH problem because people all over the Internet are crying that zsh tab completion messes up their prompt if they use emojis in their prompt (?).
Tested on MacOS/Cygwin/Linux.
Using the default two line prompt with the skull-emoji. Problem is that zsh counts the length of the prompt for tab completion and the UTF characters mess with that counting. All UTF characters need to be wrapped in
%{%G<UTC character%}
.How to reproduce:
(e.g. write
echo
and then pressTAB
twice and observe how the prompt will get messed up.)This fixes it (note the two UTF8 characters following the 'n'):
I think this is actually a ZSH problem because people all over the Internet are crying that zsh tab completion messes up their prompt if they use emojis in their prompt (?).