Skip to content

Commit

Permalink
Fix colored output of tools on Windows (doldecomp#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
BR- authored Jan 27, 2024
1 parent 1afb3e7 commit 37ea54b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ def main():
pyperclip.copy(output)
if args.print:
if args.color:
try:
import colorama
colorama.just_fix_windows_console()
except ModuleNotFoundError:
pass
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import CLexer
Expand Down
5 changes: 5 additions & 0 deletions tools/m2ctx/m2ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def main():

if not args.quiet:
if args.colorize:
try:
import colorama
colorama.just_fix_windows_console()
except ModuleNotFoundError:
pass
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import CLexer
Expand Down

0 comments on commit 37ea54b

Please sign in to comment.