From 64089f2703d0080709591a669ac3d5aa4ecd6987 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Fri, 20 Oct 2023 20:58:36 +0200 Subject: [PATCH] fix colors in windows terminal --- rendercv/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rendercv/__init__.py b/rendercv/__init__.py index d316f70..e243e2b 100644 --- a/rendercv/__init__.py +++ b/rendercv/__init__.py @@ -6,6 +6,7 @@ $\LaTeX$ file and renders it with [TinyTeX](https://yihui.org/tinytex/). """ import logging import os +import sys class LoggingFormatter(logging.Formatter): @@ -33,7 +34,8 @@ class LoggingFormatter(logging.Formatter): # Initialize logger with colors -os.system("COLOR 0") # enable colors in Windows terminal +if sys.platform == "win32": + os.system("COLOR 0") # enable colors in Windows terminal logger = logging.getLogger() logger.setLevel(logging.DEBUG) stdout_handler = logging.StreamHandler()