From 99511a4863729fe6ebc0b06d6d5a4fad7d9885f8 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Tue, 7 Feb 2023 18:53:14 -0500 Subject: [PATCH] [+] Use colorama to fix colors on Windows #45 --- hyfetch/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hyfetch/main.py b/hyfetch/main.py index bb35b368..f30cbb51 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -11,7 +11,7 @@ from typing import Iterable from . import termenv, neofetch_util from .color_scale import Scale -from .color_util import printc, clear_screen +from .color_util import clear_screen from .constants import * from .models import Config from .neofetch_util import * @@ -348,6 +348,11 @@ def run(): except ModuleNotFoundError: pass + # On Windows: Try to fix color rendering if not in git bash + if IS_WINDOWS: + import colorama + colorama.just_fix_windows_console() + # Create CLI hyfetch = color('&b&lhyfetch&r') parser = argparse.ArgumentParser(description=color(f'{hyfetch} - neofetch with flags <3'))