mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Improve the ls --color detection on OS X
This commit is contained in:
parent
27c6becffd
commit
3dc8d07d6a
1 changed files with 2 additions and 2 deletions
|
|
@ -7,8 +7,8 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
if [ "$DISABLE_LS_COLORS" != "true" ]
|
||||||
then
|
then
|
||||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
||||||
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
if [[ "$(uname -s)" =~ "(NetBSD|Darwin)" ]]; then
|
||||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
# On NetBSD and OS X, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||||
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue