diff options
author | 2006-01-18 03:20:05 +1000 | |
---|---|---|
committer | 2006-01-18 03:20:05 +1000 | |
commit | 90fbe5eb0ba1843c5dfad67dacee1dba1a230aad (patch) | |
tree | e5ec42a95c4b7aaa513452762e4f982d48cc9784 /init | |
parent | d5f4df15d464b22f00bead577e388db03b00080f (diff) |
color ls support under FreeBSD and OS X
darcs-hash:20060117172005-ac50b-6fddf68de744cfe42cab7237325025ab27fc17ad.gz
Diffstat (limited to 'init')
-rw-r--r-- | init/fish_function.fish | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/init/fish_function.fish b/init/fish_function.fish index 3f52b392..f6c1a1ba 100644 --- a/init/fish_function.fish +++ b/init/fish_function.fish @@ -168,10 +168,19 @@ end # # Make ls use colors if we are on a system that supports this # -if ls --help 1>/dev/null 2>/dev/null + +if ls --version 1>/dev/null 2>/dev/null + # This is GNU ls function ls -d "List contents of directory" command ls --color=auto --indicator-style=classify $argv end +else + # BSD, OS X and a few more support colors through the -G switch instead + if ls / -G 1>/dev/null 2>/dev/null + function ls -d "List contents of directory" + command ls -G $argv + end + end end # |