Turn off color automatically when stdout is a pipe, but allow the behavior to be...
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2006 18:51:39 +0000 (18:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2006 18:51:39 +0000 (18:51 -0000)
svn path=/main/trunk/; revision=3667

bin/emerge

index d0d1a3fdc0fd29f4ddbadc3b7593a98ca6dc7f2a..0739986f59e04515e3986e7d9dbe0444fd95631b 100755 (executable)
@@ -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: