mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-01 06:53:39 +08:00
7492b6cdb3
darcs-hash:20070116012918-ac50b-c1c0df64333ad910ca81dbc86ad193ece6680722.gz
30 lines
628 B
Fish
30 lines
628 B
Fish
#
|
|
# Make ls use colors if we are on a system that supports this
|
|
#
|
|
|
|
if command ls --version 1>/dev/null 2>/dev/null
|
|
# This is GNU ls
|
|
function ls --description "List contents of directory"
|
|
set -l param --color=auto
|
|
if isatty 1
|
|
set param $param --indicator-style=classify
|
|
end
|
|
command ls $param $argv
|
|
end
|
|
|
|
if not set -q LS_COLORS
|
|
if type -f dircolors >/dev/null
|
|
eval (dircolors -c)
|
|
end
|
|
end
|
|
|
|
else
|
|
# BSD, OS X and a few more support colors through the -G switch instead
|
|
if command ls / -G 1>/dev/null 2>/dev/null
|
|
function ls --description "List contents of directory"
|
|
command ls -G $argv
|
|
end
|
|
end
|
|
end
|
|
|