From f46f5a59287d12c07ac6f09be728729182faa158 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 22 Dec 2022 14:56:37 -0600 Subject: [PATCH] fix: don't use color if not tty --- src/viv/viv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index a8ae501..6a3c38a 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -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, "")