diff --git a/coreutils-colorls.csh b/coreutils-colorls.csh index bc07508..caabb61 100755 --- a/coreutils-colorls.csh +++ b/coreutils-colorls.csh @@ -16,7 +16,7 @@ if ($?TERM) then endif endif if ( -e "/etc/DIR_COLORS.256color" ) then - if ( "`infocmp $TERM | sed -n 's/.*colors#\([0-9]\+\).*/\1/p'`" == "256" ) then + if ( "`tput colors`" == "256" ) then set COLORS=/etc/DIR_COLORS.256color endif endif diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh index 8c75ad4..0319fbd 100755 --- a/coreutils-colorls.sh +++ b/coreutils-colorls.sh @@ -7,7 +7,7 @@ if [ -z "$LS_COLORS" ]; then COLORS=/etc/DIR_COLORS [ -e "/etc/DIR_COLORS.$TERM" ] && COLORS="/etc/DIR_COLORS.$TERM" [ -e "/etc/DIR_COLORS.256color" ] && \ - [ "`infocmp $TERM | sed -n 's/.*colors#\([0-9]\+\).*/\1/p'`" = "256" ] && \ + [ "`tput colors 2>/dev/null`" == "256" ] && \ COLORS="/etc/DIR_COLORS.256color" [ -e "$HOME/.dircolors" ] && COLORS="$HOME/.dircolors" [ -e "$HOME/.dir_colors" ] && COLORS="$HOME/.dir_colors"