anomalyco / anomalyco/opencode
Desktop: .tex files in git changes show no content when opened in review/diff viewer
@Hona is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When viewing git changes in the desktop app, modified .tex (LaTeX) files show up correctly in the changed-files list with correct add/delete stats, but selecting the file leaves the diff pane blank; no line content at all. Other text files (.ts, .md, .json, etc.) render fine. To see what actually changed in a .tex file, I have to open it in an external editor.
Since LaTeX files are plain text, the diff viewer should at least fall back to plain-text rendering.
Steps to reproduce
- Open a git project containing a
.texfile (e.g. a LaTeX report) in opencode Desktop - Modify and save the
.texfile - Open the session / git changes (review) panel, the
.texfile shows up in the changed list - Double-click / select the
.texfile - The diff body is empty; no lines are displayed
Expected behavior
- The diff (changed lines with context) renders like any other text file
- At minimum, the viewer should fall back to plain-text rendering if syntax grammar resolution fails for an unknown or unloadable language, rather than showing a blank pane
Actual behavior
Blank diff pane, but only for .tex files other file type renders normally. PDF's
Environment / Version info
- App: OpenCode Desktop (
@opencode-aidesktop) - Version: 1.18.20 (core reports
1.18.20) - OS: Windows 11 x64
- Renderer pipeline: review preview →
@pierre/diffs(FileDiff/VirtualizedFileDiff) with Shiki highlighter (preferredHighlighter: "shiki-wasm"), language derived from filename viagetFiletypeFromFileName
Additional context (from digging through the source, hope this helps triage)
@pierre/diffs@1.2.10mapstex/ltx/styto the"tex"language, andshiki@4.2.0's full bundle does include a bundledtexgrammar, so the mapping itself looks fine.- In isolation (Node, headless), both
resolveLanguage("tex")and oniguruma tokenization of a.texsample succeed, so the bug is likely specific to how the desktop build loads or bundles grammars or workers. WorkerPoolManager.resolveLanguagesAndExecuteTask()swallows language-resolution errors and just drops the render task (catch { cleanWorkerAndTask(...) }), with no plain-text fallback. Any failure in that path produces exactly this symptom: a silently empty diff. Adding a fallback there would make the viewer robust for any unrecognized extension, not just.tex.
File specifics:the .tex file I tested with was under 400 lines.
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.