# [PATCH] Do no colorify test output if stdout is not a terminal

2 messages from 2007-11-01 to 2007-11-01. Participants: Alex Riesen, Junio C Hamano.
Thread: https://gitlist.dev/t/10563

## Alex Riesen, 2007-11-01 14:01

Subject: [PATCH] Do no colorify test output if stdout is not a terminal
Message-ID: <20071101140158.GA14475@steel.home>
URL: https://gitlist.dev/e/20071101140158.GA14475%40steel.home

```
like when the output is redirected into a file in a cron job.
---
 t/test-lib.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 714de6e..603a8cd 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -60,6 +60,7 @@ esac
 # . ./test-lib.sh
 
 [ "x$TERM" != "xdumb" ] &&
+	[ -t 1 ] &&
 	tput bold >/dev/null 2>&1 &&
 	tput setaf 1 >/dev/null 2>&1 &&
 	tput sgr0 >/dev/null 2>&1 &&
-- 
1.5.3.4.549.g2789

```

## Junio C Hamano, 2007-11-01 22:47

Subject: Re: [PATCH] Do no colorify test output if stdout is not a terminal
Message-ID: <7vd4ut8twr.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd4ut8twr.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20071101140158.GA14475@steel.home>

```
Good catch.  Thanks.

```
