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

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.

Leave a Comment