commit 87d03008a558c86fe5a45d694905ccbf188a8bde
Author: Kacper Kornet <[email protected]>
Date:   Wed May 8 22:03:04 2013 +0100

    teeboth: Colorize output only for interactive jobs

 teeboth | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/teeboth b/teeboth
index 6c0f533..0612d64 100755
--- a/teeboth
+++ b/teeboth
@@ -16,6 +16,7 @@ open my $fout, ">>", $out or die "Can't write to $out: $!" if 
$out;
 my $select = IO::Select->new();
 my $alive = 1;
 my $pid;
+my $interactive = -t STDOUT;
 
 my $code;
 sub sigchld
@@ -54,7 +55,7 @@ while ( $alive ) {
        foreach my $h ( $select->can_read() ) {
                sysread $h, $_, 1024;
                print $fout $_ if $fout;
-               if ( $h == \*child_err ) {
+               if ( $h == \*child_err && $interactive ) {
                        print "\033[31m$_\033[0m";
                } else {
                        print $_;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/87d03008a558c86fe5a45d694905ccbf188a8bde

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to