Completion chooses incorrect prefix among filenames
CT075 opened this issue · comments
Description
When tab-completing the name of a file with the completion
module enabled, prezto sometimes pre-fills a prefix that is not universal among all options in the directory.
Expected behavior
Attempting to tab-complete filenames should list and cycle through all candidate files in the directory.
Actual behavior
Tab-completion auto-fills the first character of an arbitrary file in the directory. Pressing tab again completes the name of that file, rather than cycling through other files in the directory.
See here. Notice that, despite foo/aaaa
and foo/bbbb
being present, attempting to autocomplete ls foo/
first gives foo/B
(a prefix for which no file exists), then foo/bbbb
, skipping foo/aaaa
entirely.
Steps to Reproduce
It is inconsistent on my system (that is, it does not occur in every folder), but I can seem to reproduce it consistently when exactly two ambiguous results are present.
- Create an empty folder
foo
- Create files
aaa
andbbb
in folder ls foo/<TAB>
I believe this is related to prezto and not completion in general because using regular tab completion with zsh -f
correctly lists both foo/aaa
and foo/bbb
when prompted.
Versions
- Prezto commit: c9c716e
- ZSH version: zsh 5.9 (x86_64-redhat-linux-gnu)
- OS information: Fedora release 38 (thirty-eight)