ohmyzsh: Autocomplete doesn't work corrently on certain folder names

Describe the bug

Autocomplete doesn’t work on certain foldernames. In my case it usually adds “0-” before my search term and “-” to end.

This has been issue at least for year IIRC.

I started fresh in root account, installed ohmyzsh (with curl) and got same results as in my personal config.

Quick test seems to be indicating that if first folder has 2 letters before - and second folder has 3 letters before -, then bug seems to appear.

I included my test cases and asciinema recording also.

Steps to reproduce

  1. Install ohmyzsh
  2. run mkdir my-longfoldername-firstname you-longfoldername-secondname
  3. type cd long<tab><tab>

Expected behavior

It should autocomplete like it would in case of:

  1. Install ohmyzsh
  2. run mkdir my-dir-2 your-dir-1
  3. type cd dir<tab><tab>
  4. autocomplete works as intended

Screenshots and recordings

https://asciinema.org/a/qqwzYW445NxNEwaPERNwoPc3a

OS / Linux distribution

Pop_os 22.04

Zsh version

5.8.1

Oh My Zsh version

master (673b9fc)

Terminal emulator

Kitty 0.28.0

If using WSL on Windows, which version of WSL

None

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Closing this as it’s something from Zsh and not from our side!

@roeniss you have to subscribe to the mailing list and wait for someone to reply again to the mail thread so you get an email that you can reply on, or if that’s not an option send a new email to the mailing list referencing that thread by URL or number. See https://zsh.org/mla

I was able to reproduce using zsh docker image with with 5.8.1, but it’s not reproducible anymore when using 5.9. I wasn’t able to fix that issue using completion, but it seems it’s some regression with case insensitive completion. It’s something from zsh itself, and it’s not only related to cd, so we can’t do anything. You can workaround that error adding CASE_SENSITIVE=true in your zshrc before sourcing oh-my-zsh.sh. This will make completion to be case sensitive but also avoid this error. It seems like zsh team solved it in 5.9, try to update if you can. Thanks for the report!