Cursor Agent side panel custom Syntax highlighting breaks

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Syntax highlighting broke in the Agent side panel, in e.g. python files syntax highlighting works. This behaviour started after adding a Google API key. The problematic syntax highlighting is a manual extension from VSCode, that was loaded in by a .vsix file. Re-importing the theme did not resolve the issue. The syntax highlighting only occurs when agent chat pastes a code block in chat (see attachments below)

Steps to Reproduce

Add a Google API key with a custom syntax highlighting activated, and start using a google model in Cursor chat. Delete the API key. Syntax highlight stays broken in the Agent side panel.

Expected Behavior

The user should always be able to set the Syntax highlighting in Cursor chat that matches the global setting. If this breaks, the user should be able to restore the setting.

Operating System

MacOS

Version Information

Version: 2.6.12
VSCode Version: 1.105.1
Commit: 1917e900a0c4b0111dc7975777cfff60853059d0
Date: 2026-03-04T21:41:18.914Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

Yes - Cursor becomes more difficult to use

I would be really happy if you could assist me on this issue, I currently tried to restore this setting by :

1. Cleared Cursor caches:

~/Library/Application Support/Cursor/Cache

~/Library/Application Support/Cursor/Code Cache

~/Library/Application Support/Cursor/GPUCache

~/Library/Application Support/Cursor/CachedData

~/Library/Application Support/Cursor/Service Worker

2. Reset theme-related entries in Cursor SQLite state DB (state.vscdb).

3. Restored parts of Cursor config from Time Machine:

- User/globalStorage:

- Service Worker

- CachedData

4. Reinstalled the VSIX theme manually.

5. Verified the theme package.json and theme JSON structure.

6. Confirmed the theme works in editor but not inside the Cursor chat webview.

Hey, thanks for the detailed report and for all the troubleshooting you’ve already done.

From the screenshot, it looks like the code blocks in the chat panel aren’t using your custom theme. A couple of things that’ll help narrow this down:

  1. Could you switch to one of Cursor’s built-in themes, like Dark Modern, and check if syntax highlighting in the chat panel works correctly there? This will tell us if the issue is specific to custom .vsix themes in the webview.

  2. What’s the name of the custom theme you’re using?

The chat panel renders code blocks in a separate webview, so custom themes installed via .vsix sometimes don’t carry over correctly. The fact that it works fine in the editor supports that.

I think the Google API key change might just be a coincidence, but testing with a built-in theme will help confirm.

Let me know what you find.

Thanks for the response, really appreciate it. I indeed found that for the pre-built themes it works as expected. My custom theme also worked until today, which is this theme:

This issue started happening today around 11:15 CET . It happened exactly after I activated my Google Gemini API key, which might indeed be a coincidence.

Really hope me, or your team, can do something to resolve it :slight_smile: . Looking forward to your response.

Dear Dean Rie and team,

I restored an older Cursor backup, including both USER/.cursor and USER/Library/Application Support/Cursor, but the issue persists. It seems likely related to a recent update at your side.

Please let me know if there are plans to address this or if there is a way to manually alter the chat window settings. I would really appreciate being able to use custom syntax highlighting again. Now it’s hard to use, since some colors are hard to distinguish on a white background in chat (see below) :slight_smile: .

Screenshot 2026-03-09 at 09.41.09

Warm regards & hope to hear,

Jeroen

Dear Dean and Team,

Could you write a brief response on the above if you have time? Really looking forward to it :slight_smile:.

Warm regards,

Jeroen

Hey Jeromekem, thanks for the follow-up and for confirming the built-in themes work fine.

This helps narrow it down. The chat panel uses a webview to render code blocks, and custom themes installed via .vsix don’t always apply correctly inside that webview. The editor and the chat panel use different rendering paths, which is why your JupyterLab Light theme looks right in the editor but not in chat.

Right now there isn’t a manual workaround. Webview theming is handled internally and isn’t something users can configure.

I’ve flagged this to the team. No ETA yet, but your report helps us prioritize it. For now, you can switch to a built-in light theme like “Light Modern” for better readability in the chat panel.

I’ll update this thread if anything changes. Let me know if you have any questions.

Dear @deanrie Happy to say I think I figured it out. This custom theme for example >did< work correctly in Agent chat:

It seems that my previous custom theme was missing a section “tokenColors”. Apparently in the recent updates, your webview expects to receive that part from a custom theme. Here is the piece I used to make the Agent chat panel syntax highlighting readable, with a custom theme that might miss these fields:

"tokenColors": [
		{
  "name": "Fallback: Comments",
  "scope": [
    "comment",
    "punctuation.definition.comment"
  ],
  "settings": {
    "fontStyle": "italic",
    "foreground": "#407f7f"
  }
},
{
  "name": "Fallback: Strings",
  "scope": [
    "string",
    "punctuation.definition.string.begin",
    "punctuation.definition.string.end"
  ],
  "settings": {
    "foreground": "#ba2223"
  }
},
{
  "name": "Fallback: Numbers",
  "scope": [
    "constant.numeric",
    "constant"
  ],
  "settings": {
    "foreground": "#007f01"
  }
},
{
  "name": "Fallback: Operators",
  "scope": [
    "keyword.operator"
  ],
  "settings": {
    "fontStyle": "bold",
    "foreground": "#a922ff"
  }
},
{
  "name": "Fallback: Keywords",
  "scope": [
    "keyword",
    "storage"
  ],
  "settings": {
    "fontStyle": "bold",
    "foreground": "#007f01"
  }
},
{
  "name": "Fallback: Functions & Classes",
  "scope": [
    "entity.name.function",
    "entity.name.type",
    "support.function",
    "support.type"
  ],
  "settings": {
    "foreground": "#1400ff"
  }
},
{
  "name": "Fallback: Variables",
  "scope": [
    "variable",
    "variable.parameter"
  ],
  "settings": {
    "foreground": "#0055a9"
  }
},
{
  "name": "Fallback: Punctuation",
  "scope": [
    "punctuation"
  ],
  "settings": {
    "foreground": "#212121"
  }
},

Hey thanks, great debug. This is a really helpful find. The webview in the chat panel now relies on the theme’s tokenColors section, and if it’s missing, syntax highlighting falls back to default values.

This’ll help us handle this case better so themes without tokenColors still render correctly in the chat panel.

Glad we figured it out. I’ll mark this as solved.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.