From 6304a789ab280e4a6e984faedd4b046f703327e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 4 Oct 2016 01:25:36 +0200 Subject: [PATCH] Only set default LS_COLORS if not set before Also, force the use of Bourne-style shell syntax with `dircolors -b`. --- lib/theme-and-appearance.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 43e245e1..621cd067 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