Skip to content

Commit fa0a1ea

Browse files
committed
Initialize colorama for Windows compatibility in MarkdownRenderer and ContentRenderer
1 parent 969bc11 commit fa0a1ea

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

interpreter/ui/markdown.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class MarkdownElement(Enum):
2222

2323
class MarkdownRenderer:
2424
def __init__(self):
25+
if os.name == "nt":
26+
import colorama
27+
colorama.init()
2528
# ANSI escape codes
2629
self.BOLD = "\033[1m"
2730
self.CODE = "\033[7m" # Regular inline code stays inverted

interpreter/ui/tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
class ContentRenderer:
1616
def __init__(self, style):
17+
if os.name == "nt":
18+
import colorama
19+
colorama.init()
1720
self.buffer = ""
1821
self.started = False
1922
self.style = style

0 commit comments

Comments
 (0)