From 2acdf685b1df61c987afb1e27dc59603e075ee33 Mon Sep 17 00:00:00 2001 From: clach04 Date: Sun, 4 Jun 2023 16:23:32 -0700 Subject: [PATCH] Fix issue #33 - no color output expected when redirecting stdout --- copyparty/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/copyparty/__init__.py b/copyparty/__init__.py index 2809857d..9a067f80 100644 --- a/copyparty/__init__.py +++ b/copyparty/__init__.py @@ -33,6 +33,7 @@ WINDOWS: Any = ( VT100 = "--ansi" in sys.argv or ( os.environ.get("NO_COLOR", "").lower() in ("", "0", "false") + and sys.stdout.isatty() and "--no-ansi" not in sys.argv and (not WINDOWS or WINDOWS >= [10, 0, 14393]) )