Cursor cannot use existing WSL ssh-agent for Git, while Ghostty and VS Code can

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor integrated terminal cannot access existing WSL ssh-agent, while Windows Terminal, Ghostty, and VS Code can

Steps to Reproduce

I start an SSH agent in a WSL Ubuntu shell and add my SSH key:

eval “$(ssh-agent -s)”
ssh-add ~/.ssh/id_ed25519

After this:

Git operations from the original Ubuntu shell, a new Ghostty instance, VS Code terminals & GUI work without prompting for the SSH key passphrase.
However, Cursor’s integrated terminal and even the GUI cannot access the SSH agent and Git operations prompt for authentication again. (check screenshot)

Expected Behavior

Cursor’s integrated terminal and even the GUI must access the SSH agent and Git operations must not prompt for authentication again.

Screenshots / Screen Recordings

Operating System

Windows 10/11
Linux

Version Information

Version: 3.30.14 (user setup)
VS Code Extension API: 1.128.0
Commit: 5f54c8173e5552412beb40702adac16275677fa0
Date: 2026-11-13T06:36:47.504Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 43.8.9
Chromium: 150.0.7871.250
Node.js: 24.22.1
V8: 15.0.245.31-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26300

Additional Information

Windows 11
WSL2 (Ubuntu 24.04)
zsh
Cursor IDE
Git over SSH

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @Neosal, this comes down to where Cursor’s WSL session gets its environment. eval "$(ssh-agent -s)" only sets SSH_AUTH_SOCK in that one shell and anything started from it, and Cursor’s WSL server doesn’t pick up the environment of the shell you launched it from. It only sees what your ~/.zshrc exports, so the terminal and Source Control never find the agent.

As a workaround, give the agent a fixed socket and export it from ~/.zshrc:

  1. Add this to ~/.zshrc:
    export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock"
    ssh-add -l >/dev/null 2>&1
    if [ $? -eq 2 ]; then
      rm -f "$SSH_AUTH_SOCK"
      ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null
    fi
    
  2. Open a new Ubuntu shell and run ssh-add ~/.ssh/id_ed25519.
  3. In Cursor, press Ctrl+Shift+P and run “WSL: Kill Remote Server and Reload Window”.

After that, ssh-add -l in Cursor’s terminal should list your key and Git should stop asking.

Thank you but, this is a good workaround. I logged this as a bug because the issue started just a few days ago. Earlier cursor never used to ask for the credentials whenever
I used to run

eval “$(ssh-agent -s)”
ssh-add ~/.ssh/id_ed25519

Then launched from the terminal using
cursor .