visual-studio-codeshortcutvs-code-settingscursor-ide

The code . command opens Cursor instead of VS code


When you install the "Cursor" AI code editor / IDE on Windows, it takes over the code command which many developers often use in the terminal to quickly open VSCode. For example, the issue arises if you navigate to a folder with your code repo and type code . it will open that folder in "Cursor" instead of "VS Code".

This is fine if you wish to replace Cursor with VS Code as your default IDE. But if you wish to use both "Cursor" and "VS Code", such replacement of default behavior is annoying, when you want to launch VS Code. I prefer to open VS Code when code . command is used, and wish to open "Cursor" if cursor . is typed. So how to have ability to quickly open both VS Code and cursor on CLI?

Reference: https://namvu.net/2025/01/cursor-stole-your-code-command-heres-how-to-revert-it/


Solution

  • On Windows:

    1. Locate where the local applications' resources are stored. Typically these will be in
      C:\Users\<your-user-name>\AppData\Local\Programs\ folder
    2. In resources for cursor in cursor\resources\app\bin, You should see two identical files code.cmd and cursor.cmd.
    3. You should delete code.cmd and a file named code
    4. Now try both commands in terminal-
      code . will open VS code as usually preferred by VS code users, whereas
      cursor . should open the cursor AI editor.enter image description here