Installing "cursor" shell command overrides "code" as well

Hi, thanks for reporting an issue with Cursor.

Before you report this, we’d appreciate if you can search this forum to see if this issue has already been reported.

If you have done so, please check this box.
on

Describe the Bug

Currently, there is no clear distinction between the cursor and code command location.
When installing cursor on a new machine, it will place 2 files in %LOCALAPPDATA%\Programs\cursor\resources\app\bin: code.cmd and cursor.cmd
The path is then added to the %PATH% system environment variable, even when only the “cursor shell command” should be installed.
This causes cursors “code.cmd” to be found first.

I’ve explicitly NOT clicked on the “install code shell command” on the initial setup since I use the “code” shell command on a daily basis.

Steps to Reproduce

  • Install VSCode (via Default User Installer) with path registration
    • code shell command should open VSCode
  • Install cursor
  • Install “cursor” shell command
    • The “code” shell command is now starting cursor instead

Expected Behavior

The “code” shell command should not start cursor but vscode instead

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

[Window Title]
Cursor

[Main Instruction]
Cursor

[Content]

Version: 0.44.11
VSCode Version: 1.93.1
Commit: fe574d0820377383143b2ea26aa6ae28b3425220
Date: 2025-01-03T07:59:06.361Z (5 days ago)
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

[Copy] [OK]

Additional Information

Uninstalling and then reinstalling cursor has no effect. Removing cursor will restore the ability to use “code” to launch vscode but reinstalling cursor overrides it again.

Deleting the code.cmd restores the ability to launch vscode via the code shell command with cursor installed.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, try reinstalling the shell directly from VSCode. This should work. First, uninstall it and then reinstall it. For some reason, when the shell for Cursor is installed, it overrides the existing code command.

Hi deanrie, thank you for the recommendation. Unfortunately, the mentioned shell command is not available in my installation of VSCode 1.96.2 (user setup).

But even if the command is available in VSCode, it would not work:
The problem on windows is, user environment variables take precedence over system wide environment variables - except for the PATH variable.
If you install VSCode via the default User Installer (which applies to the majority of the VSCode users), it will update the User PATH Environment Variable.
Windows looks through the system PATH first to find code, then through the user PATH.

Cursor installs itself - similar to the VSCode user installer - into the %LOCALAPPDATA% - BUT it updates the System PATH Variable. (This is also problematic on multi-user systems, but thats a different discussion.)

I’m not looking for a workaround, I just intend to report this as a bug:

  • Cursor should not register a code command when only a cursor command is requested
  • Cursor should update the User PATH, not the System PATH if the installer installs the editor in a USER Directory (i.e. Local Appdata)
  • Cursor should remove itself from the PATH on uninstall

For those people that are looking for a workaround, there are currently only 2 to my knowledge

  • Install VSCode System Install (User Install is the default). The System Installer updates the system PATH instead of the user PATH, giving VSCode the chance to be “the first” in the path.
  • Remove the code.cmd from the Cursor installation (found in %LOCALAPPDATA%\Programs\cursor\resources\app\bin)

Just be aware that the first option can break due to how the PATH Variable is handled.