Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/

like image 946
codefun Avatar asked Mar 27 '26 10:03

codefun


1 Answers

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
like image 88
codefun Avatar answered Mar 30 '26 01:03

codefun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!