Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[BUG REPORT] Nonsensical behavior in response to Tab key



Hello,

I recently started using Manjaro KDE edition and it comes by default
with zsh, as opposed to bash which I was used to from other
distributions.

Often, when I write commands whose arguments are paths in the
filesystem, I'll type the first characters of a file or folder name
and hit tab to either have it autocompleted or see the list of files
and/or folders that start with that substring.

And often, in that situation, I get behavior that differs
significantly from other shells. I understand that I have a bias
towards considering the behavior I'm used to "right" and anything new
(zsh's behavior) "wrong", but in most cases I can't understand the
rationale behind zsh's behavior and I'm pretty sure that in many cases
it's plain wrong.

In this report I'll describe one particular case that simply can't be
right. I'll be happy to be proven wrong (well not really, but please
do).

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

    AddonsLab_LinkBack
    AddonsLab_LinkChecker

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

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

OBSERVED:
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.




Messages sorted by: Reverse Date, Date, Thread, Author