Bring back NO_COLOR support.

Fixes #5028.
This commit is contained in:
David Logie 2023-12-07 09:28:29 +00:00
parent c4c82e908e
commit 2136f3a3cd

View file

@ -591,7 +591,7 @@ def colorize(color_name, text):
"""Colorize text if colored output is enabled. (Like _colorize but
conditional.)
"""
if config["ui"]["color"]:
if config["ui"]["color"] and "NO_COLOR" not in os.environ:
global COLORS
if not COLORS:
# Read all color configurations and set global variable COLORS.