From 2d9d2fac75980398994c8a806f33cc26dde504cb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 26 Jun 2006 18:51:39 +0000 Subject: [PATCH] Turn off color automatically when stdout is a pipe, but allow the behavior to be overridden via the NOCOLOR environment variable. svn path=/main/trunk/; revision=3667 --- bin/emerge | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/emerge b/bin/emerge index d0d1a3fdc..0739986f5 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3435,6 +3435,9 @@ def emerge_main(): if settings.get("NOCOLOR","") in ("yes","true"): nocolor() + elif (not sys.stdout.isatty()) and \ + settings.get("NOCOLOR","") not in ("no","false"): + nocolor() tmpcmdline = sys.argv[1:] if "--ignore-default-opts" not in tmpcmdline: -- 2.26.2