sorin-ionescu / prezto

The configuration framework for Zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

  1. Create an empty folder foo
  2. Create files aaa and bbb in folder
  3. 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)