fix: don't use color if not tty

This commit is contained in:
Daylin Morgan 2022-12-22 14:56:37 -06:00
parent ad9512a747
commit f46f5a5928

View file

@ -128,7 +128,7 @@ class Ansi:
end: str = "\033[0m"
def __post_init__(self):
if os.getenv("NO_COLOR"):
if os.getenv("NO_COLOR") or not sys.stdout.isatty():
for attr in self.__dict__:
setattr(self, attr, "")