aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/msg.py2
-rw-r--r--lib/bb/ui/knotty.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index 93575d89c..3e18596fa 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -230,7 +230,7 @@ def logger_create(name, output=sys.stderr, level=logging.INFO, preserve_handlers
console = logging.StreamHandler(output)
console.addFilter(bb.msg.LogFilterShowOnce())
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
- if color == 'always' or (color == 'auto' and output.isatty()):
+ if color == 'always' or (color == 'auto' and output.isatty() and os.environ.get('NO_COLOR', '') == ''):
format.enable_color()
console.setFormatter(format)
if preserve_handlers:
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 5a97d040b..f86999bb0 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -179,7 +179,7 @@ class TerminalFilter(object):
new[3] = new[3] & ~termios.ECHO
termios.tcsetattr(fd, termios.TCSADRAIN, new)
curses.setupterm()
- if curses.tigetnum("colors") > 2:
+ if curses.tigetnum("colors") > 2 and os.environ.get('NO_COLOR', '') == '':
for h in handlers:
try:
h.formatter.enable_color()