Merge pull request #2249 from pabrahamsson/obsd_colorls
Add support for colored ls output on OpenBSD
Diff
1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
2index 2677615c046e2933f6ae4bac48aa75130d09c563..0353f9db4d1c5ac973264132c316fde2dc084cf7 100644
3--- a/lib/theme-and-appearance.zsh
4+++ b/lib/theme-and-appearance.zsh
5@@ -11,6 +11,10 @@ then
6 # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
7 # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
8 gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
9+ elif [[ "$(uname -s)" == "OpenBSD" ]]; then
10+ # On OpenBSD, test if "colorls" is installed (this one supports colors);
11+ # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
12+ colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
13 else
14 ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
15 fi