Attempt to bypass rich's color removal process when dumping to bash variable

This commit is contained in:
Micah Jerome Ellison 2023-10-30 17:23:49 -07:00
parent c2a97f3100
commit 26f3af90bb

View file

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