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),