Description
When the LLM returns a response containing LaTeX math formulas (both \$...$\ and \\(...\\)\ formats), the opencode CLI displays them as raw LaTeX source code instead of rendering them as formatted math expressions. For example, instead of seeing a properly rendered fraction \�/b, the terminal shows \\(\\frac{a}{b}\\)\ or \$\\frac{a}{b}$.
Environment
- Mode: opencode CLI (terminal)
- Model: opencode zen / DeepSeek V4 Flash Free
- Platform: Windows 11 (PowerShell 7)
- OpenCode version: latest
Expected behavior
LaTeX math expressions should be rendered in the terminal (e.g., via Unicode approximations, or a terminal-compatible math renderer). Common approaches used by other CLI tools include:
- Converting LaTeX to Unicode (e.g., \\\mu\ → \μ, \\\sum\ → \∑, \x^2\ → \x²)
- Using terminal-compatible math rendering libraries (e.g., \sympy\ pretty-print style)
- At minimum, instructing the LLM system prompt to avoid LaTeX syntax and use plain Unicode math or ASCII alternatives when in CLI mode
Actual behavior
Raw LaTeX source is displayed verbatim in the terminal, making formulas difficult or impossible to read.
Related issues
Suggested fix
The system prompt for CLI mode should instruct models to output math using Unicode characters or plain-text alternatives instead of LaTeX delimiters, since there is no LaTeX renderer in the terminal. Alternatively, implement a lightweight terminal-side LaTeX-to-Unicode converter.
Description
When the LLM returns a response containing LaTeX math formulas (both \$...$\ and \\(...\\)\ formats), the opencode CLI displays them as raw LaTeX source code instead of rendering them as formatted math expressions. For example, instead of seeing a properly rendered fraction \�/b, the terminal shows \\(\\frac{a}{b}\\)\ or \$\\frac{a}{b}$.
Environment
Expected behavior
LaTeX math expressions should be rendered in the terminal (e.g., via Unicode approximations, or a terminal-compatible math renderer). Common approaches used by other CLI tools include:
Actual behavior
Raw LaTeX source is displayed verbatim in the terminal, making formulas difficult or impossible to read.
Related issues
Suggested fix
The system prompt for CLI mode should instruct models to output math using Unicode characters or plain-text alternatives instead of LaTeX delimiters, since there is no LaTeX renderer in the terminal. Alternatively, implement a lightweight terminal-side LaTeX-to-Unicode converter.