vscode.openWith('latex-workshop-pdf-hook') is a no-op when a PDF is already open in Cursor's built-in viewer, so LaTeX Workshop SyncTeX fails

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor’s built-in PDF viewer keeps ownership of an already-open *.pdf tab. LaTeX Workshop SyncTeX then calls the documented VS Code API:

vscode.openWith(pdfUri, “latex-workshop-pdf-hook”)

When that PDF is already open in Cursor’s built-in viewer, the call is a no-op. The PDF tab is not reopened with the LaTeX Workshop custom editor, so SyncTeX fails. This is the editor PDF custom-editor / tab layer, not Chat, Terminal, CLI, or Cloud Agents.

Steps to Reproduce

  1. Use Cursor IDE with LaTeX Workshop 10.18.0 and a PDF open in Cursor’s built-in PDF viewer.
  2. Trigger LaTeX Workshop SyncTeX so it invokes the documented API above.
  3. Observe that the already-open PDF tab remains owned by the built-in viewer and vscode.openWith(…) does nothing; SyncTeX does not navigate/open the LaTeX Workshop custom editor.

Expected Behavior

An already-open PDF should be reopened or transferred to “latex-workshop-pdf-hook” so LaTeX Workshop SyncTeX can navigate to the corresponding source location.

Operating System

MacOS

Version Information

Version: 3.16.29
VSCode Version: 1.128.0
Commit: 6246455961129c32969845e00aa25d87ae926ec0
Date: 2026-08-18T01:26:26.285Z
OS: Darwin arm64 25.5.0
LaTeX Workshop: james-yu.latex-workshop 10.18.0

For AI issues: which model did you use?

Not an AI issue. N/A

For AI issues: add Request ID with privacy disabled

N/A

Additional Information

macOS Darwin 25.5.0, Apple Silicon (arm64). This is the editor PDF custom-editor / tab layer, not Chat, Terminal, CLI, or Cloud Agents.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. A couple of quick checks so we can pinpoint the issue.

In the classic Editor Window, Cursor doesn’t have its own built-in PDF viewer. Usually the .pdf tab belongs to a third-party extension, like tomoki1207.pdf, which Cursor suggests when you open a PDF. So vscode.openWith doing nothing is most likely because the tab is owned by a different viewer than the one LaTeX Workshop expects.

To see what’s happening, right-click the open PDF tab, pick Reopen Editor With…, and check which viewer is marked as active. Send what you see there.

For now, forward search should work if you force PDFs to open in the LaTeX Workshop viewer. Add this to settings.json:

"workbench.editorAssociations": {
    "*.pdf": "latex-workshop-pdf-hook"
}

After that, PDFs should open in LaTeX Workshop by default, and SyncTeX can navigate in a tab owned by the extension itself. Let me know if it helped and what Reopen Editor With… showed.