From 75f00f65212e4139e2ee7acbb6257f87e01cba57 Mon Sep 17 00:00:00 2001 From: shuki Date: Fri, 6 Mar 2026 01:31:15 +0200 Subject: [PATCH] Fix Rich markup rendering in operation log Use Text.from_markup() for strings containing Rich tags so [red]...[/red] renders as colored text instead of raw tags. Co-Authored-By: Claude Opus 4.6 --- tui/widgets/operation_log.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tui/widgets/operation_log.py b/tui/widgets/operation_log.py index 460fec6..d95124a 100644 --- a/tui/widgets/operation_log.py +++ b/tui/widgets/operation_log.py @@ -1,3 +1,4 @@ +from rich.text import Text from textual.app import ComposeResult from textual.screen import ModalScreen from textual.widgets import RichLog, Button, Static @@ -25,4 +26,8 @@ class OperationLog(ModalScreen[None]): self.dismiss(None) def write(self, text: str) -> None: - self.query_one("#ol-log", RichLog).write(text) + log = self.query_one("#ol-log", RichLog) + if "[" in text and "[/" in text: + log.write(Text.from_markup(text)) + else: + log.write(text)