Merge pull request #1531 from lcosmin/master
Fixed 'ls' issue on NetBSD
Diff
1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
2index aec67721a8414ba3386b4d2a9f87306235e3eb16..2677615c046e2933f6ae4bac48aa75130d09c563 100644
3--- a/lib/theme-and-appearance.zsh
4+++ b/lib/theme-and-appearance.zsh
5@@ -7,7 +7,13 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
6 if [ "$DISABLE_LS_COLORS" != "true" ]
7 then
8 # Find the option for using colors in ls, depending on the version: Linux or BSD
9- ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
10+ if [[ "$(uname -s)" == "NetBSD" ]]; then
11+ # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
12+ # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
13+ gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
14+ else
15+ ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
16+ fi
17 fi
1819 #setopt no_beep