anomalyco / anomalyco/opencode
TUI: Markdown syntax rendered as raw text in assistant messages
@simonklee is already working on this.
Since Jul 25, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Bug Description
Assistant text messages in the TUI display raw markdown syntax instead of formatted output. Literal **bold**, \inline code`, ----separators, and##` headers are printed as-is.
Expected Behavior
- bold → ANSI bold escape codes
inline code→ distinct color/background, backticks strippedcode blocks→ syntax highlighted (tree-sitter) or indented/boxed----→ full-width divider character (─)## Header→ bold/colored, no leading#
Current Behavior
All markdown syntax appears literally in the terminal output.
Relevant Code
The TextPart component in packages/tui/src/routes/session/index.tsx (line ~1679) uses the <markdown> element from @opentui/core:
<markdown
syntaxStyle={syntax()}
streaming={true}
internalBlockMode="top-level"
content={props.part.text.trim()}
tableOptions={{ style: "grid" }}
conceal={ctx.conceal()}
fg={theme.markdownText}
bg={theme.background}
/>
The ReasoningPart (line ~1572) uses <code filetype="markdown"> for reasoning blocks.
It appears the <markdown> component from @opentui/core (v0.4.5) is not converting markdown syntax to ANSI-styled terminal output — the raw markdown passes through unformatted.
Environment
- opencode version: 1.18.5
- Terminal: iTerm2 on macOS
@opentui/coreversion: 0.4.5
Notes
The project already has marked (v17.0.6) and marked-shiki (v1.2.1) in dependencies, which could be used as an alternative markdown-to-ANSI renderer if the @opentui/core <markdown> component is not intended to handle this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.