anomalyco / anomalyco/opencode

Desktop: .tex files in git changes show no content when opened in review/diff viewer

Open
#44,719 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Open a git project containing a .tex file (e.g. a LaTeX report) in opencode Desktop
  2. Modify and save the .tex file
  3. Open the session / git changes (review) panel, the .tex file shows up in the changed list
  4. Double-click / select the .tex file
  5. 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 via getFiletypeFromFileName

Additional context (from digging through the source, hope this helps triage)

  • @pierre/diffs@1.2.10 maps tex/ltx/sty to the "tex" language, and shiki@4.2.0's full bundle does include a bundled tex grammar, so the mapping itself looks fine.
  • In isolation (Node, headless), both resolveLanguage("tex") and oniguruma tokenization of a .tex sample 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.