Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh tab completion messes up terminal #28

Open
SkyperTHC opened this issue Jul 31, 2022 · 0 comments
Open

zsh tab completion messes up terminal #28

SkyperTHC opened this issue Jul 31, 2022 · 0 comments

Comments

@SkyperTHC
Copy link

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:

docker run --rm  -it kalilinux/kali-rolling
apt update -y
apt install -y --no-install-recommends zsh
zsh -il

echo<TAB><TAB>

(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 (?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant