Steps to reproduce Install zsh and ohmyzsh run mkdir my-longfoldername-firstname you-longfoldername-secondname type cd long terminal shows "cd O-longfoldername- " instead of trying to autocomplete. Expected behavior It should autocomplete like it would in case of: Install ohmyzsh run mkdir my-dir-2 your-dir-1 type cd dir autocomplete works as intended How to reproduce with docker: Create Dockerfile: FROM ubuntu:23.04 RUN apt-get update && apt-get install -y zsh curl git RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" RUN mkdir my-longfoldername-firstname you-longfoldername-secondname CMD zsh Build with: docker build -t zsh-test . Run with: docker run -ti zsh-test cd long will produce the error while cd fold works. cd old produces another error (cd F-longfoldername-), so 0- isn't always first character It seems that this doesn't happen on archlinux or macOS. POP_OS/Ubuntu seems to be affected, so this seems to be an OS dependent issue. Issue tested in zsh 5.8.1 and 5.9 + latest ohmyzsh More info/discussion here: https://github.com/ohmyzsh/ohmyzsh/issues/11621