I've been having an issue with zsh completion that's becoming a rather large annoyance. It's completing options beyond where there is ambiguity. For example, in a directory with these files:


If I type "less ti" and then hit tab, zsh completes to this "tilertest-00_1408311." as opposed to stopping where I want it to ("tilertest"). Strangely, if I provide any kind of path (i.e. "less ./ti") it seems to work just fine. How can I change it to stop at the very first ambiguity? I've included my .zshrc file. I should also note I'm using oh-my-zsh.

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Uncomment the following line to use case-sensitive completion.

# Uncomment the following line to disable bi-weekly auto-update checks.

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

 # Uncomment the following line to disable colors in ls.

 # Uncomment the following line to disable auto-setting terminal title.

 # Uncomment the following line to disable command auto-correction.

 # Uncomment the following line to display red dots whilst waiting for     completion.

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-  zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)

source $ZSH/oh-my-zsh.sh

# User configuration

export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl"
# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

1 Answer 1


The option that controls a part of this behavior is menu_complete. So, you need:

unsetopt menu_complete

(but it appears that oh-my-zsh already does this). If this isn't sufficient, in case oh-my-zsh does anything special, you may also try:

zstyle ':completion:*' completer _complete
bindkey '\t' expand-or-complete

You can also compare the behavior with zsh -f and in the new shell:

autoload -U compinit
bindkey -e

If you get the incorrect behavior here, this is probably a bug in your zsh version. Otherwise, try to see which oh-my-zsh change (in its files) triggers the problem. Before hitting the Tab key, you can type CtrlX h in order to get context information on the following completion (this may help you to find what's going on).

Once you have found the solution, to make it permanent, put it in your .zshrc after any change done by oh-my-zsh, so typically at or near the end of the file.

  • Should I be adding this to my .zshrc file? I tried that, and it doesn't seem to have worked.
    – cmilke
    Sep 3, 2014 at 9:29
  • oh-my-zshell still doesn't seem to work, but standard zsh does. As I'm using only the most minimalist features of zsh, I think I'm going to simply uninstall oh-my-zsh. Thank you for the help though.
    – cmilke
    Sep 4, 2014 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.