[arch-projects] [mkinitcpio][PATCH 3/8] mkinitcpio: avoid color when stdout isn't a tty
Dave Reisner
d at falconindy.com
Thu Jan 5 14:26:09 EST 2012
Follow suit with lsinitcpio (change 0495018d) and make output colorless
on redirecting/piping stdout.
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
mkinitcpio | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mkinitcpio b/mkinitcpio
index 475b197..b6581ed 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -148,7 +148,7 @@ while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do
done
shift $((OPTIND - 1))
-if [[ -t 2 ]] && (( COLOR )); then
+if [[ -t 1 ]] && (( COLOR )); then
# prefer terminal safe colored and bold text when tput is supported
if tput setaf 0 &>/dev/null; then
NC="$(tput sgr0)"
--
1.7.8.1
More information about the arch-projects
mailing list