[output] support 'NO_COLOR' environment variable

This commit is contained in:
Mike Fährmann
2024-05-03 02:03:59 +02:00
parent 699592498b
commit dc9d83e64b
2 changed files with 20 additions and 16 deletions

View File

@@ -91,7 +91,7 @@ def main():
signal.signal(signal_num, signal.SIG_IGN)
# enable ANSI escape sequences on Windows
if util.WINDOWS and config.get(("output",), "ansi", True):
if util.WINDOWS and config.get(("output",), "ansi", output.COLORS):
from ctypes import windll, wintypes, byref
kernel32 = windll.kernel32
mode = wintypes.DWORD()