Environment Variable file syntax highlighting gone

In the last few updates, I lost colours in .env files. I found a similar problem in another thread, but that was for Mac and looks like it was sorted.

Latest Update MacOS Environment Variable file syntax highlighting gone

My bug is exactly the same but in Windows:

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Editor, Tab & Chat (autocomplete, Composer, in-editor agent)
  • Terminal & commands
  • Models, pricing & API keys (availability, Auto/Max, BYOK/Bedrock)
  • MCP & tools
  • Cloud Agents & Automations (cursor.com/agents, scheduled/event)
  • BugBot & Code Review
  • Cursor CLI
  • Cursor Mobile
  • Remote (SSH / Dev Containers / WSL)
  • Account, billing & login
  • Something else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!

Hi @mrkaon Thanks for the post! What you’re running into is a little different from the thread you linked. .env files are being read correctly on your version, and you can actually see that in your screenshot: your comments are still styled, and the status bar shows the language as Environment Variables. What’s missing is the color. Cursor’s built-in themes don’t currently include colors for the individual parts of a .env file, so keys and values both land within a hair of the normal text color, and the whole file reads as flat gray. Nothing on your end caused this, and it isn’t something you misconfigured. I’ve let the team know.

In the meantime, there are three ways to get color back, depending on how close to the old look you want to land:

1. Switch themes. Dark Modern (Ctrl+K Ctrl+T) colors .env keys light blue out of the box.

2. Keep your current theme and set the colors yourself. Add this to your settings.json:

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": ["variable.key.dotenv", "variable.other.env"],
      "settings": { "foreground": "#82D2CE" }
    },
    {
      "scope": ["property.value.dotenv", "constant.language.env"],
      "settings": { "foreground": "#E394DC" }
    }
  ]
}

3. Restore the exact previous look. Also in settings.json:

"files.associations": { "**/.env*": "properties" }

This renders .env files with the same coloring they had before, teal keys and pink values, and # comments still work as expected.

I’ll post here with any relevant updates. If any of the above settings don’t land correctly, let me know and I’ll a second look to verify on my test machine.

I created the other thread. This was never fixed for me. It had coloured syntax highlighting for more than a year and a half that I’ve used cursor until recently.

even though they said it was fixed. Nothing changed for me. Yes it shows environment variables bit the color was being zeroed out on the default dot env styling. I just had cursor create a new one and I assign properties styling to environment variables as a work around.

Tried option 3 and it worked.
Thanks