Second try to bypass rich's color code suppression

This commit is contained in:
Micah Jerome Ellison 2023-10-30 17:42:05 -07:00
parent 26f3af90bb
commit 6c7d7923e2

View file

@ -136,7 +136,7 @@ def format_msg_text(msg: Message) -> Text:
def wrap_with_ansi_colors(text: str, width: int) -> str: def wrap_with_ansi_colors(text: str, width: int) -> str:
richtext = Text.from_ansi(text, no_wrap=False, tab_size=None) richtext = Text.from_ansi(text, no_wrap=False, tab_size=None)
console = Console(width=width, no_color=False) console = Console(width=width, force_terminal=True)
with console.capture() as capture: with console.capture() as capture:
console.print(richtext, sep="", end="") console.print(richtext, sep="", end="")
return capture.get() return capture.get()