Skip to content

Instantly share code, notes, and snippets.

@rsampaths16
Created April 3, 2023 14:53
Show Gist options
  • Save rsampaths16/706f664f78126b984b32f22c6d2a20a1 to your computer and use it in GitHub Desktop.
Save rsampaths16/706f664f78126b984b32f22c6d2a20a1 to your computer and use it in GitHub Desktop.
Tab auto-completion expansion / suggestions on ZSH prompt has a weird gap

Tab auto-completion expansion / suggestions on ZSH prompt has a weird gap

Are you facing an issue in ZSH prompt, where auto-complete tab expansion adds a weird gap in the prefix? Where you can't clear them with undo? And the command can run successfully without any issue?

ex:

You type a command partially and hit TAB

$ sens<TAB>

The command expands nicely till a common perfix, when you hit the TAB again

$ sensible-<TAB>

Oh no. The ZSH prompt looks broken. A small prefix se has repeated

$ sesensible-pager
sensible-browser  sensible-editor   sensible-pager

Even on backspace they don't seem to be cleared and the only way is to enter a new line

$ se

This could be because of the local configuration

The fix on Ubuntu

You can try isntalling the same package and generating the local in other distros;

# list the supported locales on the machine
locale -a

# To check the locales that are being used
echo $LC_ALL
echo $LANG

# If they aren't available install the locales
sudo apt-get clean && sudo apt-get update
sudo apt-get install locales
sudo locale-gen `{locale-name}` # EX: sudo locale-gen en_IN.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment