From 2c962ef8fc385a824880591348113b717d0ce9b9 Mon Sep 17 00:00:00 2001 From: Vignesh Natarajan Date: Sat, 14 Feb 2026 19:08:15 -0800 Subject: [PATCH] fix (tui): keep assistant text contrast theme-adaptive --- src/tui/components/assistant-message.ts | 4 +++- src/tui/theme/theme.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tui/components/assistant-message.ts b/src/tui/components/assistant-message.ts index 04dd7d9dbbb..6afdc6acf86 100644 --- a/src/tui/components/assistant-message.ts +++ b/src/tui/components/assistant-message.ts @@ -7,7 +7,9 @@ export class AssistantMessageComponent extends Container { constructor(text: string) { super(); this.body = new Markdown(text, 1, 0, markdownTheme, { - color: (line) => theme.fg(line), + // Keep assistant body text in terminal default foreground so contrast + // follows the user's terminal theme (dark or light). + color: (line) => theme.assistantText(line), }); this.addChild(new Spacer(1)); this.addChild(this.body); diff --git a/src/tui/theme/theme.ts b/src/tui/theme/theme.ts index 18fa5f4d44a..2444cfd78f9 100644 --- a/src/tui/theme/theme.ts +++ b/src/tui/theme/theme.ts @@ -61,6 +61,7 @@ function highlightCode(code: string, lang?: string): string[] { export const theme = { fg: fg(palette.text), + assistantText: (text: string) => text, dim: fg(palette.dim), accent: fg(palette.accent), accentSoft: fg(palette.accentSoft),