summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-11-10 00:08:05 -0500
committerDax Raad <[email protected]>2025-11-10 00:08:05 -0500
commit2fbb49ac30852325390b23c5e321fa7d87d6963e (patch)
treefd23dd36a54135cec4956d6c924302a6ff32e885 /packages
parentc56b407e1d74b85dd6f3b3aa6bd7555fe9b6dd01 (diff)
downloadopencode-2fbb49ac30852325390b23c5e321fa7d87d6963e.tar.gz
opencode-2fbb49ac30852325390b23c5e321fa7d87d6963e.zip
tui: render reasoning parts with syntax highlighting instead of plain text
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/tui/routes/session/index.tsx13
1 files changed, 11 insertions, 2 deletions
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 50bf21e0f..c7f080142 100644
--- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
@@ -945,7 +945,8 @@ const PART_MAPPING = {
}
function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }) {
- const { theme } = useTheme()
+ const { theme, syntax } = useTheme()
+ const ctx = use()
return (
<Show when={props.part.text.trim()}>
<box
@@ -957,7 +958,15 @@ function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }
borderColor={theme.backgroundPanel}
>
<box paddingTop={1} paddingBottom={1} paddingLeft={2} backgroundColor={theme.backgroundPanel}>
- <text fg={theme.text}>{props.part.text.trim()}</text>
+ <code
+ filetype="markdown"
+ drawUnstyledText={false}
+ streaming={true}
+ syntaxStyle={syntax()}
+ content={props.part.text.trim()}
+ conceal={ctx.conceal()}
+ fg={theme.text}
+ />
</box>
</box>
</Show>