3

I am using Prezto + zsh as my shell. I would like to change the color of directories when I ls my directory.

For instance, here is what I currently have:

My crappy ls listing

Obviously, this is no fun, as I'm hardly able to read my directories because the blue is so dark. I'd like to change it to white or orange or something lighter.

This dark blue is specific only to directories. Files show up in a nice white text.

Where and what settings must I find to change this?


Attempted solutions:

I tried adding

eval $(dircolors -p | sed -e 's/DIR 01;34/DIR 01;36/' | dircolors /dev/stdin)

to my zshrc, but am getting this error now when loading my prompts:

Blockquote

  • 1
    Is this on a Mac? Macs don't have GNU coreutils, so don't have /usr/bin/dircolors. See unix.stackexchange.com/questions/91937/… – cas Oct 17 '15 at 21:51
  • It is on a Mac, yes. I'm running El Capitan also. So your solution won't work for me, will it? – Cole Bittel Oct 17 '15 at 21:56
  • not unless you install GNU coreutils. The link i posted has more info on setting ls colours on a Mac as well as info on installing coreutils. – cas Oct 17 '15 at 22:04
3

Yeah, dark blue on black is unreadable.

Find the line in your ~/.bashrc or ~/.zshrc or other profile script that looks like this:

eval $(dircolors)

and change it to this:

eval $(dircolors -p | sed -e 's/DIR 01;34/DIR 01;36/' | dircolors /dev/stdin)

That changes blue ("01;34") to cyan ("01;36")

Alternatively, edit your terminal program's colour scheme and change the Dark Blue to a more readable colour.

  • I don't have this line in my ~/.zshrc file. I would definitely mark this answer correct if you could illustrate further how to find this line. – Cole Bittel Oct 17 '15 at 20:29
  • According to the zsh man page, zsh uses ~/.zshenv, ~/.zprofile, ~/.zshrc, ~/.zlogin and ~/.zlogout. System-wide zsh settings are in /etc/zsh/zshenv, /etc/zsh/zprofile, /etc/zsh/zshrc, /etc/zsh/zlogin, and /etc/zsh/zlogout. The zlogout files wont be setting dircolors, but any of the others might. – cas Oct 17 '15 at 21:18
  • It doesn't really matter which of those set it. If you add the eval $(dircolors -p | sed ... line to the end of ~/.zshrc it will override any earlier definition. – cas Oct 17 '15 at 21:20
  • I attempted this solution, but ran into an error. I've edited my question to reflect this attempt. – Cole Bittel Oct 17 '15 at 21:34
  • 1
    @anh_ng8 that works (which is why i mentioned it in my last paragraph above), but is a pain if you use multiple terminals on multiple systems - you have to change the config for all of them in tedious point-and-click dialog boxes (it's what i used to do before i got annoyed enough by it to read the dircolors man page and figure out how to fix it in my .bashrc). It's easier to just not let dircolors use dark-blue on black. – cas Jul 18 '16 at 11:46
1

I was able to fix this on my Mac OS X El Capitan by installing gnu coreutils

Install Homebrew

Then install coretuils

brew install coreutils

Then set PATH in your ~/.zshrc

export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
0

A simple way is to change the ANSI Color blue in the preferences of the Terminal.app (OSX).

  • 2
    This answer were be much more useful if you would explain how to change the color in preferences. – Stephen Rauch Apr 20 '17 at 17:12

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.