run tput colors in colorls profile.d scripts only in the interactive

mode(#450424)
This commit is contained in:
Ondrej Vasik 2010-03-20 07:44:52 +00:00
parent edc268cf05
commit 515305b108
3 changed files with 7 additions and 3 deletions

View File

@ -17,7 +17,7 @@ if ($?TERM) then
endif
endif
if ( -e "/etc/DIR_COLORS.256color" ) then
if ( "`tput colors`" == "256" ) then
if ( "`tty -s && tput colors`" == "256" ) then
set COLORS=/etc/DIR_COLORS.256color
endif
endif

View File

@ -18,7 +18,7 @@ if [ -z "$USER_LS_COLORS" ]; then
done
[ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \
[ "x`tput colors 2>/dev/null`" = "x256" ] && \
[ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \
COLORS="/etc/DIR_COLORS.256color"
if [ -z "$COLORS" ]; then

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.4
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -337,6 +337,10 @@ fi
%{_libdir}/coreutils
%changelog
* Sat Mar 20 2010 Ondrej Vasik <ovasik@redhat.com> - 8.4-6
- run tput colors in colorls profile.d scripts only
in the interactive mode(#450424)
* Fri Feb 12 2010 Ondrej Vasik <ovasik@redhat.com> - 8.4-5
- fix exit status of terminated child processes in su with
pam(#559098)