Something's wrong in out-of-the-box configuration of zsh


I reported this to zsh first, but their reply included this:

That’s certainly screwy, but you’re not getting basic zsh behaviour here,
and I’m not going to try to speculate what is happening.
[…] you’ll need to […] find out what configuration you do have.

Whatever configuration I do have is what came out of the box with Manjaro, and it’s certainly wrong as the following case demonstrates.

1) I am inside a directory that contains the following two directories:


plus many others with names starting with “AddonsLab_”

2) I start typing “cd Addons” and hit the Tab key

As expected that gets partially autocompleted until “cd AddonsLab_” and stops

3) I continue typing until I have “cd AddonsLab_Link” and I hit Tab again

it should show me the list of files and folders whose name starts with
“AddonsLab_Link”, which are the two listed above.

1) It partially autocompletes to “cd AddonsLab_Linkc” ending with a
lowercase “c”. That makes no sense whatsoever.
There were two folders that matched “AddonsLab_Link”, and it didn’t
show me the two options. It’s like it has already decided to pick
AddonsLab_LinkChecker (wrong, should let me choose), but instead of
autocompleting it completely, it stops after the C, which it also for
some reason changes to lowercase. There’s no directory (or file for
that matter) that starts with “AddonsLab_Linkc”, and the only one that
starts with “AddonsLab_LinkC”.

I could understand this behavior if both the following were true:

  • the folder AddonsLab_LinkBack didn’t exist (nor any other starting
    with AddonsLab_Link not followed by a ‘C’ or ‘c’)
  • besides AddonsLab_LinkChecker there was at least one folder starting
    with AddonsLab_Linkc with a lowercase ‘c’

Being a little more tolerant, I could understand the behavior
replacing the second condition with “besides AddonsLab_LinkChecker
there was at least one other folder starting with ‘AddonsLab_LinkC’
with an uppercase or lowercase ‘C’”.

But none of that is the case.

2) Then if I hit Tab again, it autocompletes “cd
AddonsLab_LinkChecker”. This second part makes sense given the
previous one which didn’t.

I can reproduce all of the above starting with an empty folder:

Run the following sequence of commands:

mkdir testzshbug
cd testzshbug
mkdir AddonsLab_whatever
mkdir AddonsLab_LinkBack
mkdir AddonsLab_LinkChecker

Then type “cd AddonsLab_Link” and hit Tab.

Your profile says you’re using KDE. If so, the only customization done is the theme. See usr/share/konsole/Breath.profile · master · Profiles & Settings / manjaro-kde-settings · GitLab

Please post the contents of your ~/.zshrc using proper formatting.

Haha, nice one. I can replicate it on arch too. You can try with other names too, eg. BinkDada, BinkCacha and you’ll get cd binkdaD.

I narrowed it down to (what I have):

zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'

If I wasn’t so lazy, I’d go and read this… zsh: 19 Completion Widgets