[F] termios cannot be imported on Windows

https://github.com/hykilpikonna/hyfetch/issues/16
This commit is contained in:
Hykilpikonna 2022-11-22 14:52:09 -05:00
parent 0fbf8d58cc
commit 79a086fcc3
No known key found for this signature in database
GPG key ID: 256CD01A41D7FA26

View file

@ -9,9 +9,8 @@ from itertools import permutations
from math import ceil
from typing import Iterable
from . import termenv
from .color_scale import Scale
from .color_util import printc, color, clear_screen, AnsiMode
from .color_util import printc, clear_screen
from .constants import *
from .models import Config
from .neofetch_util import *
@ -86,7 +85,10 @@ def create_config() -> Config:
:return: Config object (automatically stored)
"""
# Detect terminal environment
# Detect terminal environment (doesn't work on Windows)
det_bg, det_ansi = None, None
if platform.system() != 'Windows':
from . import termenv
det_bg = termenv.get_background_color()
det_ansi = termenv.detect_ansi_mode()