Skip to content

Commit 91e33c5

Browse files
committed
fix(tui): draw no tool input key or value in red
The tool input block drew its keys in the property color, which is red in opencode, the catppuccin themes, one-dark, tokyonight, everforest and orng, and in the transcript red means a failed tool call. Keys, values and punctuation now take their colors from toolCodeTheme (packages/tui/src/theme/tool-code.ts), the same non-red palette as the bash command: keys use the property color, falling back to the function color, then the type color, where it is red. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm e6434eb AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
1 parent b236851 commit 91e33c5

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎packages/tui/src/routes/session/index.tsx‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import { detectFiletype, filetype } from "../../util/filetype"
7171
import { highlightCached } from "../../util/highlight-cache"
7272
import { narrowBashHighlights } from "../../util/bash-highlight"
7373
import { highlightHeredocs } from "../../util/heredoc"
74+
import { toolCodeTheme } from "../../theme/tool-code"
7475
import {
7576
fitsInline,
7677
formatToolInput,
@@ -2243,6 +2244,8 @@ type ToolProps = {
22432244
function GenericTool(props: ToolProps) {
22442245
const { theme } = useTheme()
22452246
const ctx = use()
2247+
// Never red: in the transcript red means a failed tool call.
2248+
const code = createMemo(() => toolCodeTheme(theme))
22462249
const output = createMemo(() => props.output?.trim() ?? "")
22472250
const [expanded, setExpanded] = createSignal(false)
22482251
const limit = createMemo(() => TuiConfig.toolOutputLimit(ctx.tui.tool_output, props.tool, "generic"))
@@ -2273,14 +2276,14 @@ function GenericTool(props: ToolProps) {
22732276
<ToolInput
22742277
rows={block().rows}
22752278
colors={{
2276-
indent: theme.text,
2277-
key: theme.syntaxVariable,
2278-
punctuation: theme.syntaxPunctuation,
2279-
string: theme.syntaxString,
2280-
number: theme.syntaxNumber,
2281-
boolean: theme.syntaxKeyword,
2282-
null: theme.syntaxKeyword,
2283-
fold: theme.textMuted,
2279+
indent: code().text,
2280+
key: code().syntaxVariable,
2281+
punctuation: code().syntaxPunctuation,
2282+
string: code().syntaxString,
2283+
number: code().syntaxNumber,
2284+
boolean: code().syntaxKeyword,
2285+
null: code().syntaxKeyword,
2286+
fold: code().textMuted,
22842287
}}
22852288
/>
22862289
<Show when={showOutput() && limited()}>

0 commit comments

Comments
 (0)