[+] Use colorama to fix colors on Windows #45

This commit is contained in:
Azalea Gui 2023-02-07 18:53:14 -05:00
parent fec5ebe628
commit 99511a4863
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B

View file

@ -11,7 +11,7 @@ from typing import Iterable
from . import termenv, neofetch_util from . import termenv, neofetch_util
from .color_scale import Scale from .color_scale import Scale
from .color_util import printc, clear_screen from .color_util import clear_screen
from .constants import * from .constants import *
from .models import Config from .models import Config
from .neofetch_util import * from .neofetch_util import *
@ -348,6 +348,11 @@ def run():
except ModuleNotFoundError: except ModuleNotFoundError:
pass 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 # Create CLI
hyfetch = color('&b&lhyfetch&r') hyfetch = color('&b&lhyfetch&r')
parser = argparse.ArgumentParser(description=color(f'{hyfetch} - neofetch with flags <3')) parser = argparse.ArgumentParser(description=color(f'{hyfetch} - neofetch with flags <3'))