">Toggle Comment" command uses improper syntax in `.env` files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

If I have a .env file open, and I try to comment out a line by running the “>Toggle Comment” command, it will use ; instead of #, resulting in a syntax error. For example, ; LOG_LEVEL=info instead of # LOG_LEVEL=info.

However it is deceiving because the syntax highlighting shows the line as “grayed out”, even though it’s not really commented out.

Steps to Reproduce

Open a .env file in Cursor IDE. Find a variable that is defined, and execute the “>Toggle Comment” command (cmd + /). Notice that a ; is used instead of a #

Expected Behavior

The # symbol is supposed to be used to create a comment in a .env file

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.29 (Universal)
VSCode Version: 1.105.1
Commit: 4ca9b38c6c97d4243bf0c61e51426667cb964bd0
Date: 2026-01-08T00:34:49.798Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @_nikita!

I tried it out and when I have a .env file opened and run “Toggle Line Comment”, a # is properly added.

In the lower right of Cursor, can you check if your .env file is being detected as a properties file, or maybe something else like ini?

Oh yeah the .env file was being detected as a ”Properties” file. I updated it to “env” and now it’s working as expected. Thanks!

1 Like