Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider this minimal .zshrc :

export CLICOLOR=1;
export LSCOLORS=exfxcxdxbxegedabagacad; # It is the default value on OSX, so this line can be omitted

autoload -Uz compinit
zstyle ':completion:*' list-colors 'exfxcxdxbxegedabagacad'

On OS X, ls uses colors if CLICOLOR is set to TRUE and the colors used are in LSCOLORS which default value is exfxcxdxbxegedabagacad.

Doing a ls will print directories in blue. But when doing cd + TAB, ZSH will propose completions with directories in red and in bold. What is the problem and how can I have the same colors for ZSH completion and ls?

share|improve this question

migrated from May 30 '11 at 10:21

This question came from our site for professional and enthusiast programmers.

You need to read the instructions carefully: zsh knows how to handle LS_COLORS, which is the GNU/Linux variant of ls color configuration, but you use OSX's/BSD's LSCOLORS. They are very different, and it appears zsh doesn't know how to handle the latter.

LSCOLORS example for red output:


LS_COLORS example for red output:


Use e.g. this tool (also on Github) to create a nice color scheme, or recreate the one you use, copy its output for Linux LS_COLORS, then use the following to set the colors:

# between quotation marks is the tool output for LS_COLORS
export LS_COLORS="di=31;41:ln=31;41:so=31;41:pi=31;41:ex=31;41:bd=31;41:cd=31;41:su=31;41:sg=31;41:tw=31;41:ow=31;41:"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
share|improve this answer

You must log in to answer this question.