Skip to content

Commit

Permalink
🐛 - Properly support color in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
drinfernoo committed May 1, 2022
1 parent bed2024 commit b16c9c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions _repo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ def is_a_tty():
return hasattr(sys.stdout, "isatty") and sys.stdout.isatty()

def legacy_support():
color = 0
console = 0
if sys.platform in ["linux", "linux2"]:
color = os.system("color")
color = 0
if sys.platform in ["linux", "linux2", "darwin"]:
pass
elif sys.platform == "win32":
color = os.system("color")

from ctypes import windll

k = windll.kernel32
console = k.SetConsoleMode(k.GetStdHandle(-11), 7)
elif sys.platform == "darwin":
pass

return color == 1 or console == 1
return any([color == 1, console == 1])

return any(
[
Expand Down

0 comments on commit b16c9c1

Please sign in to comment.