7

In plain zsh, tree is set similar to --color=auto by default. However, when I use Oh-My-Zsh, tree doesn't show colors. Since tree does not have a --color=auto option, how can I override the setting back to the auto one?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Franklin Yu
  • 1,227
  • 12
  • 23

1 Answers1

6

I found the answer after I posted an issue on Oh-My-Zsh's repository. Color in tree rely on LS_COLORS, which is not set by Zsh by default; but my ~/.zshrc set the variable after I hit "use default setting" option, with a single line

eval "$(dircolors -b)"

which looks insignificant. After installing Oh-My-Zsh, the setting is moved to ~/.zshrc.pre-oh-my-zsh, so LS_COLORS is lost again, and my tree becomes black and white.

In other words, I moved that setting from ~/.zshrc.pre-oh-my-zsh back to .zshrc, and I am now with my colorful tree.

Franklin Yu
  • 1,227
  • 12
  • 23