From be177ab6c880d954338aabfc8eb3d44b2d0ff2e6 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 1 Feb 2016 22:22:49 +0100 Subject: don't colorize when stdout is not a tty, except when -G is passed multiple times --- lr.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lr.c') diff --git a/lr.c b/lr.c index 61d4e38..808e741 100644 --- a/lr.c +++ b/lr.c @@ -1640,6 +1640,9 @@ main(int argc, char *argv[]) exit(2); } + if (Gflag == 1 && !isatty(1)) + Gflag = 0; + analyze_format(); if (optind == argc) { -- cgit 1.4.1