diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx index d786e0b4918..0768ca5f5ab 100644 --- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx @@ -53,6 +53,7 @@ type ThemeColors = { info: RGBA text: RGBA textMuted: RGBA + toolOutput: RGBA selectedListItemText: RGBA background: RGBA backgroundPanel: RGBA @@ -131,9 +132,10 @@ type ColorValue = HexColor | RefName | Variant | RGBA type ThemeJson = { $schema?: string defs?: Record - theme: Omit, "selectedListItemText" | "backgroundMenu"> & { + theme: Omit, "selectedListItemText" | "backgroundMenu" | "toolOutput"> & { selectedListItemText?: ColorValue backgroundMenu?: ColorValue + toolOutput?: ColorValue thinkingOpacity?: number } } @@ -199,7 +201,7 @@ function resolveTheme(theme: ThemeJson, mode: "dark" | "light") { const resolved = Object.fromEntries( Object.entries(theme.theme) - .filter(([key]) => key !== "selectedListItemText" && key !== "backgroundMenu" && key !== "thinkingOpacity") + .filter(([key]) => key !== "selectedListItemText" && key !== "backgroundMenu" && key !== "thinkingOpacity" && key !== "toolOutput") .map(([key, value]) => { return [key, resolveColor(value as ColorValue)] }), @@ -222,6 +224,13 @@ function resolveTheme(theme: ThemeJson, mode: "dark" | "light") { resolved.backgroundMenu = resolved.backgroundElement } + // Handle toolOutput - optional with fallback to text + if (theme.theme.toolOutput !== undefined) { + resolved.toolOutput = resolveColor(theme.theme.toolOutput) + } else { + resolved.toolOutput = resolved.text + } + // Handle thinkingOpacity - optional with default of 0.6 const thinkingOpacity = theme.theme.thinkingOpacity ?? 0.6 diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 0d9ddc746c2..4043c777f9a 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1614,7 +1614,7 @@ function GenericTool(props: ToolProps) { onClick={overflow() ? () => setExpanded((prev) => !prev) : undefined} > - {limited()} + {limited()} {expanded() ? "Click to collapse" : "Click to expand"} @@ -1824,7 +1824,7 @@ function Bash(props: ToolProps) { $ {props.input.command} - {limited()} + {limited()} {expanded() ? "Click to collapse" : "Click to expand"}