How do I change the colour of directory listings with oh-my-fish?

11,364

You are probably seeing the result of LSCOLORS, which you can look up in the ls man page or Google.

The reason that you see this with fish and not, say, bash, is that fish wraps ls in a function that passes the -G flag, as you can see:

> functions ls
function ls --description 'List contents of directory'
    command ls -G $argv
end

You can change LSCOLORS to be something else, e.g. on OS X:

set -Ux LSCOLORS gxfxbEaEBxxEhEhBaDaCaD

That makes a universal environment variable, so you just have to run it once.

Or you can disable it entirely by overwriting the function:

function ls ; command ls ; end
funcsave ls

This creates and saves a function ls that has priority over the bundled one.

Share:
11,364
Paymahn Moghadasian
Author by

Paymahn Moghadasian

Updated on June 02, 2022

Comments

  • Paymahn Moghadasian
    Paymahn Moghadasian almost 2 years

    I've recently decided to give the fish shell a shot and also started using oh-my-fish. The problem I'm having is that I can't figure out how to change the color of directory listings when running a command such as ls. The picture attached below shows directories being listed in a dark blue and files listed in a gray.

    enter image description here

    I've tried changing the theme to no avail and I can't figure out where else to look. Any ideas?