2d964086af95f4b46589459643f20ca00bbb8102

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Merge branch 'patch-ls-g-alias'

Closes #4988

Diff

 1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
 2index 122e3fecb61bba01b7ec071b7bccc11e259ff141..f368a48f05591e8a04e15907b36b538d92e836b0 100644
 3--- a/lib/theme-and-appearance.zsh
 4+++ b/lib/theme-and-appearance.zsh
 5@@ -21,7 +21,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
 6     colorls -G -d . &>/dev/null && alias ls='colorls -G'
 7   elif [[ "$OSTYPE" == darwin* ]]; then
 8     # this is a good alias, it works by default just using $LSCOLORS
 9-    alias ls='ls -G'
10+    ls -G . &>/dev/null && alias ls='ls -G'
11 
12     # only use coreutils ls if there is a dircolors customization present ($LS_COLORS or .dircolors file)
13     # otherwise, gls will use the default color scheme which is ugly af
14@@ -32,7 +32,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
15       (( $+commands[dircolors] )) && eval "$(dircolors -b)"
16     fi
17 
18-    ls --color -d . &>/dev/null && alias ls='ls --color=tty' || alias ls='ls -G'
19+    ls --color -d . &>/dev/null && alias ls='ls --color=tty' || ls -G . &>/dev/null && alias ls='ls -G'
20 
21     # Take advantage of $LS_COLORS for completion as well.
22     zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"