diff options
author | Marc Cornellà <marc.cornella@live.com> | 2016-10-04 01:25:36 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2016-10-04 01:29:47 +0200 |
commit | 6304a789ab280e4a6e984faedd4b046f703327e8 (patch) | |
tree | b82048f624081936b0962c41ef1506bf567fb31c /lib | |
parent | 6c08286c8e0ca4d2b48679d2692f0ce4ac443f4c (diff) | |
download | zsh-6304a789ab280e4a6e984faedd4b046f703327e8.tar.gz zsh-6304a789ab280e4a6e984faedd4b046f703327e8.tar.bz2 zsh-6304a789ab280e4a6e984faedd4b046f703327e8.zip |
Only set default LS_COLORS if not set before
Also, force the use of Bourne-style shell syntax with `dircolors -b`.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/theme-and-appearance.zsh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 43e245e16..621cd067b 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -19,7 +19,9 @@ then colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G' else # For GNU ls, we use the default ls color theme. They can later be overwritten by themes. - (( $+commands[dircolors] )) && eval "$(dircolors)" + if [[ -z "$LS_COLORS" ]]; then + (( $+commands[dircolors] )) && eval "$(dircolors -b)" + fi ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' fi |