Skip to content

Commit

Permalink
Force rich to use color codes when pretty printing (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahellison authored Oct 31, 2023
1 parent c2a97f3 commit cf14512
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jrnl/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, force_terminal=True)
with console.capture() as capture:
console.print(richtext, sep="", end="")
return capture.get()

0 comments on commit cf14512

Please sign in to comment.