getcursor / cursor

The AI Code Editor
https://cursor.com
20.77k stars 1.38k forks source link

WSL: cursor command fails to find the correct entrypoint #807

Open LudwigStumpp opened 11 months ago

LudwigStumpp commented 11 months ago

Issue

Calling cursor command on WSL2 fails

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/ludwi/AppData/Local/Programs/cursor/resources/app/bin/cursor: 62: /mnt/c/Users/ludwi/AppData/Local/Programs/cursor/resources/app/bin/../cursor: not found

Specification

WSL2 Path has

Note

Has anyone experienced the same issue or has an idea for me to try out?

ArcAnya commented 11 months ago

Not exactly solving the issue, but just in case fyi - had a similar issue and ended up adding the WSL extension to the Cursor IDE - now using the WSL terminal / Cursor there and that's working well for me atm.

LudwigStumpp commented 11 months ago

Not exactly solving the issue, but just in case fyi - had a similar issue and ended up adding the WSL extension to the Cursor IDE - now using the WSL terminal / Cursor there and that's working well for me atm.

Hi, thanks for your additional input on this. Indeed for me within the WSL extension I am also able to open any folder on the WSL from within the IDE. However I would like to be able to use the cursor command from the WSL terminal (as it works the same for VSCode).

mfaizan1 commented 10 months ago

Although this is not a blocker but it is really convenient to open your folders from wsl terminal. facing exactly same issue.

ddwang commented 10 months ago

For some reason the default cursor shell script is very different from the equivalent code script from VSCode. Maybe it was forked from an earlier branch?

In any case, I took the latest VSCode code script and modified it for Cursor and WSL. It works well for me and I'm able to launch Cursor directly from a WSL prompt, e.g.:

$ cursor .

Here's the gist: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394

To use, simply replace your cursor script, usually found at /mnt/c/Users/<USER_NAME>/AppData/Local/Programs/cursor/resources/app/bin/cursor

ksumesh431 commented 10 months ago

@ddwang your script works perfectly for me, but it downloads the vs code server every time I run "cursor ." Unlike vs code which just does that once and opens normally on subsequent runs

llllvvuu commented 9 months ago

Another use case is to apply the $PATH from the Terminal to Cursor.

vincentsch commented 5 months ago

I use @ddwang's script and so far it is working. But I have problems opening two or more projects at the same time from WSL in Cursor. Having opened a WSL project in Cursor and then starting Cursor from WSL in a different project directory, Cursor starts but then displays the error message "Could not fetch remote environment".

vincentsch commented 5 months ago

Another observation is that I have to repeat the process of replacing the script every few days. The script is apparently being reset to its original state on a regular schedule.

I can also no longer start the original VSCode with code . Instead, I keep getting the following error message:

Unable to determine app path from symlink : /mnt/c/Users//AppData/Local/Programs/cursor/resources/app/bin/code

ddwang commented 5 months ago

@vincentsch thanks for the debugging. I'll take a look this wknd and hopefully resolve these issues

addiaddiaddi commented 4 months ago

@vincentsch thanks for the debugging. I'll take a look this wknd and hopefully resolve these issues

Were you able to resolve this?

schlich commented 4 months ago

I hope someone is working on this! I love using Cursor on my work macOS machine, but this is a blocker for me on my home Windows machine

sandeepnmenon commented 3 months ago

+1 Same issue on my WSL

buencons commented 1 month ago

Still having this issue as well for anyone else running into this post. Fresh Win11 image + WSL2 install. Can connect to WSL remote when inside Cursor but can't do it through WSL terminal. Also tried the "Fix WSL install" through the command palette.

dkarelov commented 3 weeks ago

Same here - still does not work from the console directly.

0x33dm commented 1 week ago

any updates on this?

swayducky commented 1 week ago

I forked @ddwang 's script, made a couple improvements, and it's working for me: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4

Wasted way too much on this, but at least it works now 👍

0x33dm commented 1 week ago

I forked @ddwang 's script, made a couple improvements, and it's working for me: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4

Wasted way too much on this, but at least it works now 👍

this worked for me, thanks a lot.

I didn't find cursor on my windows variables tough, so maybe i got a slightly different install from you as i just installed this on my windows machine a couple days ago.

Remove "c:\Users\\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings

0x33dm commented 1 week ago

I forked @ddwang 's script, made a couple improvements, and it's working for me: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4

Wasted way too much on this, but at least it works now 👍

today i got this error:

ln: failed to create symbolic link '/home/xxx/.cursor-server/bin//bee043c1bb0095dab94043787985ccfc7cc38e50/bin/remote-cli/code': File exists

and when i opened cursor it seems it downloaded the WSL server again :(

0x33dm commented 1 week ago

I forked @ddwang 's script, made a couple improvements, and it's working for me: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4

Wasted way too much on this, but at least it works now 👍

Rebooted my computer and now i get this

$ cursor .
ln: failed to create symbolic link '/home/xxx/.cursor-server/bin//1252dd54bee0d8caa777cd58df6ab01192a69c30/bin/remote-cli/code': File exists
/home/hems/.local/bin/cursor: 87: /mnt/c/Users/xxx/AppData/Local/Programs/cursor//Cursor.exe: not found
0x33dm commented 1 week ago

Rebooted my computer and now i get this

$ cursor .
ln: failed to create symbolic link '/home/xxx/.cursor-server/bin//1252dd54bee0d8caa777cd58df6ab01192a69c30/bin/remote-cli/code': File exists
/home/hems/.local/bin/cursor: 87: /mnt/c/Users/xxx/AppData/Local/Programs/cursor//Cursor.exe: not found

and if i go to C:\Users\xxx\AppData\Local\Programs\cursor the entire folder is empty.

i had to download cursor again and install and it works again.

Cursor on WSL seems very unreliable. I wonder why the entire folder got wiped.

Maybe i accepted some update pop up and don't remember it. weird.

Xnuvers007 commented 1 week ago

I forked @ddwang 's script, made a couple improvements, and it's working for me: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4

Wasted way too much on this, but at least it works now 👍

it's work for me