Summary
Fenced code blocks render with white/near-white foreground text on light terminal backgrounds, making them invisible. This is a regression of previously fixed issues #16508 and #16731.
Environment
- OpenCode version: 1.2.24
- OS: macOS (darwin, arm64)
- Terminal: iTerm2 3.6.9
- Terminal theme: Poimandres Light (light background
#fefeff)
- OpenCode theme:
opencode (with theme_mode: "light")
- COLORTERM: truecolor
- TERM: xterm-256color
Reproduction
- Use a terminal with a light background color scheme
- Run OpenCode with any theme in light mode (tested:
opencode, system, catppuccin, and others — all exhibit the issue)
- Ask the AI to provide a response containing fenced code blocks (untagged,
text tag, or unknown language), flow diagrams, or commit lists
- Observe: fenced code block text is white/near-white, invisible against the light background
What is visible
- Inline code (single backticks)
- Known language-tagged code blocks (e.g.,
python)
- Headings, bold text, other markdown elements
- Dark mode rendering (all text visible)
What is invisible
- Untagged fenced code blocks
- Fenced code blocks with
text or unknown language tags
- ASCII diagrams, commit lists, and other preformatted content inside fenced blocks
Workaround
Disabling the experimental markdown renderer resolves the issue:
export OPENCODE_EXPERIMENTAL_MARKDOWN=0
Root cause (from #16508 analysis)
The experimental markdown renderer's code block rendering path falls back to a hardcoded white foreground when syntax highlighting is unavailable for the block, instead of inheriting from the active theme's text/code-block color tokens.
This was previously fixed for #16508 and #16731 (reported on v1.2.20–1.2.21), but has regressed in v1.2.24.
Related issues
Summary
Fenced code blocks render with white/near-white foreground text on light terminal backgrounds, making them invisible. This is a regression of previously fixed issues #16508 and #16731.
Environment
#fefeff)opencode(withtheme_mode: "light")Reproduction
opencode,system,catppuccin, and others — all exhibit the issue)texttag, or unknown language), flow diagrams, or commit listsWhat is visible
python)What is invisible
textor unknown language tagsWorkaround
Disabling the experimental markdown renderer resolves the issue:
export OPENCODE_EXPERIMENTAL_MARKDOWN=0Root cause (from #16508 analysis)
The experimental markdown renderer's code block rendering path falls back to a hardcoded white foreground when syntax highlighting is unavailable for the block, instead of inheriting from the active theme's text/code-block color tokens.
This was previously fixed for #16508 and #16731 (reported on v1.2.20–1.2.21), but has regressed in v1.2.24.
Related issues