mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
ls: find and use various dircolors initialisation files, if they exist
Closes #1758.
This commit is contained in:
parent
9e32b330aa
commit
4aa38db56f
1 changed files with 9 additions and 1 deletions
|
@ -14,7 +14,15 @@ if command ls --version 1>/dev/null 2>/dev/null
|
||||||
|
|
||||||
if not set -q LS_COLORS
|
if not set -q LS_COLORS
|
||||||
if type -q -f dircolors
|
if type -q -f dircolors
|
||||||
eval (dircolors -c | sed 's/>&\/dev\/null$//')
|
set -l colorfile
|
||||||
|
for file in ~/.dir_colors ~/.dircolors /etc/DIR_COLORS
|
||||||
|
if test -f $file
|
||||||
|
set colorfile $file
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
echo $colorfile
|
||||||
|
eval (dircolors -c $colorfile | sed 's/>&\/dev\/null$//')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue