Agents Window Files: Terraform (.tf) syntax highlighting intermittent and differs from IDE

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Where does the bug appear?

Agents Window → Files panel (Glass viewer)

Environment

  • macOS
  • Cursor Pro, local agent (“This Mac”)
  • Multi-root workspace with 3 repositories
  • Cursor Version: 3.17.21

Description

When viewing .tf (Terraform) files in Agents Window → Files, syntax highlighting is unreliable. Sometimes colors appear correctly; other times the same file is unstyled or looks completely different from the IDE. Behavior seems intermittent within the same session, as if extension grammars load once and then stop working (e.g. after switching tabs, reopening a file, or returning to the agent). No clear trigger yet.

This happens in a .code-workspace with 3 repos. Not sure if multi-root is related, but worth noting.

In the IDE, the same files always render correctly with the HashiCorp Terraform extension (Cmd+Shift+P → Open IDE).

This looks related to extension-provided grammars not loading consistently in the Glass file viewer. A prior forum thread on Agents Window syntax highlighting is closed, so opening a fresh report.

Workaround

Open IDE for file review when highlighting breaks.

Impact

Hard to review Terraform changes in Agents Window when highlighting drops mid-session.

Steps to Reproduce

  1. Open a multi-root workspace (.code-workspace) with 3 repositories that contain .tf files.
  2. Open Agents Window with local agent (“This Mac”).
  3. From Agents Window → Files, open a .tf file from one of the repos.
  4. Confirm syntax highlighting looks correct (HashiCorp Terraform colors).
  5. Continue in the same session: switch agent tabs, reopen the file, open a .tf from another repo in the workspace, or return from diff/review.
  6. Reopen the same .tf file in Files.
  7. Observe: highlighting is missing, wrong, or different from step 4.
  8. Cmd+Shift+P → Open IDE → open the same .tf file.
  9. Observe: highlighting is always correct in the IDE.

Expected Behavior

Stable, IDE-consistent syntax highlighting in Agents Window Files, including extension-provided grammars, in single- and multi-root workspaces.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 3.17.21
VS Code Extension API: 1.128.0
Commit: 8f2a112cb2845a97b75fd932ea5c470579ca4060
Date: 2026-08-25T01:05:08.089Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @jul1an, thanks for the detailed report and repro steps, that really helps.

This is a known issue we’re already tracking. Syntax highlighting from extensions (including HashiCorp Terraform) in Agents Window Files can stop working during a session. It’s usually more noticeable when switching between agent tabs, coming back from review or diff, or working with multiple repos in the same workspace. I’ve added your .tf and multi-root case to what we’re already seeing. I can’t share a timeline yet, but I’ll post an update here when I have one.

Workarounds:

  • Open IDE via Cmd+Shift+P then run “Open IDE”, this is the most reliable option and you already found it.
  • Sometimes just reopening the same file from the Files panel after a moment brings the colors back.

If you notice even a rough pattern that reliably triggers the highlighting loss, like always after viewing a diff or with a specific mix of file types, share it here. Those details really speed up debugging.