From e8f18fbb19cc077695c7a3308654830702fb316a Mon Sep 17 00:00:00 2001 From: Moviuro Date: Thu, 11 Sep 2014 22:40:09 +0200 Subject: [PATCH] Actually check that ls options exist before adding them to the alias. --- etc/zsh/zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 9657c72..9ce49ca 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -345,9 +345,9 @@ ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} typeset -ga ls_options typeset -ga grep_options -if ls --help 2> /dev/null | grep -q GNU; then +if ls --color=auto / >/dev/null 2>&1; then ls_options=( --color=auto ) -elif [[ $OSTYPE == freebsd* ]]; then +elif ls -G / >/dev/null 2>&1; then ls_options=( -G ) fi if grep --help 2> /dev/null | grep -q GNU || \ -- 2.1.4