mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-09 19:13:14 -06:00
fix: don't use color if not tty
This commit is contained in:
parent
ad9512a747
commit
f46f5a5928
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ class Ansi:
|
||||||
end: str = "\033[0m"
|
end: str = "\033[0m"
|
||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
if os.getenv("NO_COLOR"):
|
if os.getenv("NO_COLOR") or not sys.stdout.isatty():
|
||||||
for attr in self.__dict__:
|
for attr in self.__dict__:
|
||||||
setattr(self, attr, "")
|
setattr(self, attr, "")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue