Cursor install broke code command in WSL2

During the setup process i had the option to change the code alias to cursor; i’m pretty sure i didn’t select that.

Still did the cursor installation break the “code” command in WSL2. I now get the error:

joost@FIREGEN:~$ code .
Unable to determine app path from symlink : /mnt/c/Users/joost/AppData/Local/Programs/cursor/resources/app/bin/code

Steps to reproduce:

  1. Install cursor
  2. Restart wsl
  3. test code . command

My theory is that the cursor code bin comes before the vscode bin on the $PATH, thereby messing things up:

joost@FIREGEN:~$ echo $PATH | grep -Ei '(cursor|code)'
/home/joost/.local/bin:/home/joost/.local/share/pnpm:/home/joost/.nvm/versions/node/v18.17.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Inkscape/bin:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/150/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/150/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/150/DTS/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn/:/mnt/c/Program Files/Azure Data Studio/bin:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Calibre2/:/mnt/c/Program Files (x86)/Bluetooth Command Line Tools/bin:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files (x86)/rekordbox-repair-0.5/bin:/mnt/c/Program Files (x86)/QuickTime/QTSystem/:/mnt/c/Program Files/Intel/WiFi/bin/:/mnt/c/Program Files/Common Files/Intel/WirelessCommon/:/mnt/c/Program Files/Git LFS:/mnt/c/Program Files/Mullvad VPN/resources:/mnt/c/Users/nicol/AppData/Local/Programs/**cursor**/resources/app/bin:/mnt/c/Users/nicol/AppData/Local/Programs/Python/Python310/Scripts/:/mnt/c/Users/nicol/AppData/Local/Programs/Python/Python310/:/mnt/c/Users/nicol/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/nicol/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/nicol/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/nicol/AppData/Local/Programs/Microsoft VS **Code**/bin:/mnt/c/Users/nicol/AppData/Local/Coursier/data/bin:/mnt/c/Program Files (x86)/Nmap:/snap/bin

Uninstalling cursor fixes the problem.

1 Like

can you tell how to restart WSL ??

I renamed code->codecursor code.cmd->codecursor.cmd it fixes my code command from wsl. now my cursor command broken.

{username}:~/{projectname}$ cursor .
To use Cursor with the Windows Subsystem for Linux, please install Cursor in Windows and uninstall the Linux version in WSL. You can then use the `cursor` command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Cursor with the environment variable DONT_PROMPT_WSL_INSTALL defined.
/mnt/c/Users/{username}/AppData/Local/Programs/cursor/resources/app/bin/cursor: 62: /mnt/c/Users/{username}/AppData/Local/Programs/cursor/resources/app/bin/../cursor: