Git in UI can't fetch on WSL with SSH config

Hi there!

Cursor 0.47.8 on Windows 11, WSL 2.

My ~/.ssh/config:

Host personal
	Hostname gitlab.com
	IdentityFile ~/.ssh/my-gitlab-key
	IdentitiesOnly yes
 > git remote show origin  
Enter passphrase for key '/home/timur/.ssh/my-gitlab-key': 
* remote origin
  Fetch URL: git@personal:my-repo.git
  Push  URL: git@personal:my-repo.git

So when I click on Cursor’s button “Sync changes”, for example, it throws an error:

2025-03-19 10:15:46.324 [info] > git pull --tags origin master [1051ms]
2025-03-19 10:15:46.324 [info] Missing or invalid credentials.
Error: connect ENOENT /run/user/1000/vscode-git-db05cfc88d.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/run/user/1000/vscode-git-db05cfc88d.sock'
}
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

But it does work when:

  • I do “git pull” in the terminal
  • When I open Cursor on my Macbook and connect to my PC WSL2 as backend IDE via SSH and click on “Sync Changes” button

So in my opinion there are problem with the PC version, I guess it can’t handle my ssh config file when connects via sock to WSL, but do, when connects via SSH

Ok, seems it’s known issue from VSCode.

This fixed for me:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.