f516b7c7f5e630ab04d31e5f7da5f443b21f173f

Author
drm00 <jasmintee@gmx.de>
Committer
drm00 <jasmintee@gmx.de>
Date

Message

add check for colored ls on openbsd. (retry of #2225)

Diff

 1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
 2index 0353f9db4d1c5ac973264132c316fde2dc084cf7..2c6d4912c438a4a51647136dda3617c563ab7e83 100644
 3--- a/lib/theme-and-appearance.zsh
 4+++ b/lib/theme-and-appearance.zsh
 5@@ -12,8 +12,11 @@ then
 6     # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
 7     gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
 8   elif [[ "$(uname -s)" == "OpenBSD" ]]; then
 9-    # On OpenBSD, test if "colorls" is installed (this one supports colors);
10-    # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
11+    # On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base, 
12+    # with color and multibyte support) are available from ports.  "colorls"  
13+    # will be installed on purpose and can't be pulled in by installing 
14+    # coreutils, so prefer it to "gls".
15+    gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
16     colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
17   else
18     ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'