anomalyco / anomalyco/opencode
[CLI / TUI] LaTeX math formulas ($...$, ...) rendered as raw text without formatting
@kommander is already working on this.
Since Sep 17, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When the assistant outputs mathematical expressions or logic formulas wrapped in single ($...$) or double ($$...$$) dollar signs (for example, $$\text{Prov}(x, y)$$ or $\exists x \text{Prov}(x, y)$), OpenCode CLI / TUI displays the raw LaTeX source code verbatim with the dollar signs, rather than rendering or formatting them into readable mathematical expressions.
Expected Behavior
Mathematical expressions wrapped in LaTeX delimiters should be nicely formatted or rendered in the CLI/TUI:
- Unicode/ASCII Fallback in CLI/TUI: Parse common LaTeX symbols, superscripts, subscripts, Greek letters, and operators into Unicode characters (e.g.
\text{Prov}(x, y)→Prov(x, y),\exists→∃,\to→→,x^2→x²). - KaTeX / MathJax support in Desktop / Web GUI: Fully render LaTeX math equations when running in graphical/web mode.
- Prompt or parser-level enhancement: For terminal clients, provide guidance or pre-render transformations so mathematical equations remain readable.
Actual Behavior
The terminal outputs raw LaTeX source text including the $ / $$ delimiters directly (e.g., $$\text{Prov}(x, y)$$), which impacts readability for mathematical, logical, and algorithmic discussions.
Steps to Reproduce
- Ask OpenCode in CLI mode a math/logic question, e.g.
$$\text{Prov}(x, y)$$ 这是什么表达式. - Observe the AI response containing
$/$$delimiters displayed directly as raw text without formatting.
Environment
- Tool: OpenCode CLI / TUI
- OS: Windows / Linux / macOS
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.