Hi. I’ve been using Cursor for a while now and it’s really great.
One thing that really irritates me, however, is the fact that after installing Cursor, when I run the "code . " command in the terminal, instead of launching my default VSC editor, Cursor is launched.
How do I get VSC back to opening on this command? Cursor is great, but I still want to leave "code ." for VSCode.
This is so obnoxious. Just highlights the fact that there is no reason this shouldn’t be an VS code extension rather than piggybacking on top of Code breaking things left and right.
If you’re in Windows, open Run (Win+R) and type: %localappdata%\Programs\cursor\resources\app\bin
Delete two files:
code
code.cmd
I hope this helped.
Note -
If you are deleting above files make sure you will re-start the terminal cause it will still look the same path for code command and give the error that code is not found in \Programs\cursor\resources\app\bin.
the above step helps you delete the over written file written by cursor to open it using terminal command “code” which was for vs code.
Faced this issue on Mac OS. The cursor application overrides the code command and the only way to revert this is delete the code script (rm /usr/local/bin/code) and install ‘code’ command in PATH.
Alternatively you can edit the code script (nano /usr/local/bin/code).
- REMOTE_CLI="$(which -a 'cursor' | grep /remote-cli/)"
+ REMOTE_CLI="$(which -a 'code' | grep /remote-cli/)"
- ELECTRON="$CONTENTS/MacOS/Cursor"
+ ELECTRON="$CONTENTS/MacOS/Electron"
This way, cursor would run cursor application and code runs vs code.
No need to delete anything on Windows, just make sure the path to VS Code is set before the path to Cursor. That’s all that’s needed to make this work.
using windows, and the suggestion to delete the 2 files worked!
until it came back…
I have a feeling this has to do with cursor updates? I actually uninstalled cursor, rebooted and installed. It never asked me (like the first time) if I wanted to use “code” to open cursor and those files showed up upon the fresh install. Any suggestions? Where does the choice to use “code” to open cursor get stored during install?