Skip to content

Commit 2fbb49a

Browse files
committed
tui: render reasoning parts with syntax highlighting instead of plain text
1 parent c56b407 commit 2fbb49a

File tree

1 file changed

+11
-2
lines changed
  • packages/opencode/src/cli/cmd/tui/routes/session

1 file changed

+11
-2
lines changed

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,8 @@ const PART_MAPPING = {
945945
}
946946

947947
function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }) {
948-
const { theme } = useTheme()
948+
const { theme, syntax } = useTheme()
949+
const ctx = use()
949950
return (
950951
<Show when={props.part.text.trim()}>
951952
<box
@@ -957,7 +958,15 @@ function ReasoningPart(props: { part: ReasoningPart; message: AssistantMessage }
957958
borderColor={theme.backgroundPanel}
958959
>
959960
<box paddingTop={1} paddingBottom={1} paddingLeft={2} backgroundColor={theme.backgroundPanel}>
960-
<text fg={theme.text}>{props.part.text.trim()}</text>
961+
<code
962+
filetype="markdown"
963+
drawUnstyledText={false}
964+
streaming={true}
965+
syntaxStyle={syntax()}
966+
content={props.part.text.trim()}
967+
conceal={ctx.conceal()}
968+
fg={theme.text}
969+
/>
961970
</box>
962971
</box>
963972
</Show>

0 commit comments

Comments
 (0)