Broken SSH_AUTH_SOCK

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I utilize 1password for my SSH keys. I mount my local .gitconfig when using dev containers. This works fine in vscode, but cursor either times out on git operations or is extremely long.

Steps to Reproduce

Any git operation. For reference:

vscode - 3.1s

GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_TRACE_PACKET=1 git fetch
23:53:03.106098 git.c:502               trace: built-in: git fetch
23:53:03.189859 run-command.c:673       trace: run_command: unset GIT_PREFIX; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''as##############f.git'\'''
23:53:03.191029 run-command.c:765       trace: start_command: /usr/bin/ssh -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''as##############f.git'\'''
23:53:05.522862 pkt-line.c:85           packet:        fetch< version 2
23:53:05.522927 pkt-line.c:85           packet:        fetch< agent=git/github-26eb2912769f-Linux
23:53:05.522931 pkt-line.c:85           packet:        fetch< ls-refs=unborn
23:53:05.522933 pkt-line.c:85           packet:        fetch< fetch=shallow wait-for-done filter
23:53:05.522934 pkt-line.c:85           packet:        fetch< server-option
23:53:05.522936 pkt-line.c:85           packet:        fetch< object-format=sha1
23:53:05.522937 pkt-line.c:85           packet:        fetch< 0000
23:53:05.522942 pkt-line.c:85           packet:        fetch> command=ls-refs
23:53:05.522989 pkt-line.c:85           packet:        fetch> agent=git/2.52.0-Linux
23:53:05.523015 pkt-line.c:85           packet:        fetch> object-format=sha1
23:53:05.523019 pkt-line.c:85           packet:        fetch> 0001
23:53:05.523021 pkt-line.c:85           packet:        fetch> peel
23:53:05.523022 pkt-line.c:85           packet:        fetch> symrefs
23:53:05.523025 pkt-line.c:85           packet:        fetch> unborn
23:53:05.523059 pkt-line.c:85           packet:        fetch> ref-prefix refs/heads/
23:53:05.523064 pkt-line.c:85           packet:        fetch> ref-prefix refs/heads/fresh-start
23:53:05.523090 pkt-line.c:85           packet:        fetch> ref-prefix refs/tags/
23:53:05.523093 pkt-line.c:85           packet:        fetch> ref-prefix HEAD
23:53:05.523095 pkt-line.c:85           packet:        fetch> 0000
23:53:05.769628 pkt-line.c:85           packet:        fetch< de3f################################2de2 HEAD symref-target:refs/heads/main
23:53:05.769763 pkt-line.c:85           packet:        fetch< dcb1################################db92 refs/heads/fresh-start
23:53:05.769841 pkt-line.c:85           packet:        fetch< de3f################################2de2 refs/heads/main
23:53:05.769867 pkt-line.c:85           packet:        fetch< 0000
23:53:05.814240 run-command.c:673       trace: run_command: git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
23:53:05.814291 run-command.c:765       trace: start_command: /usr/local/libexec/git-core/git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
23:53:05.963862 pkt-line.c:85           packet:        fetch> 0000
23:53:06.193899 run-command.c:1540      run_processes_parallel: preparing to run up to 1 tasks
23:53:06.205858 run-command.c:1568      run_processes_parallel: done
23:53:06.205893 run-command.c:673       trace: run_command: git maintenance run --auto --no-quiet --detach
23:53:06.208031 run-command.c:765       trace: start_command: /usr/local/libexec/git-core/git maintenance run --auto --no-quiet --detach
23:53:06.227080 git.c:502               trace: built-in: git maintenance run --auto --no-quiet --detach

cursor - 63.1s

GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_TRACE_PACKET=1 git fetch
23:53:29.615790 git.c:502               trace: built-in: git fetch
23:53:29.685173 run-command.c:673       trace: run_command: unset GIT_PREFIX; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''as##############f.git'\'''
23:53:29.685946 run-command.c:765       trace: start_command: /usr/bin/ssh -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''as##############f.git'\'''
23:54:31.948632 pkt-line.c:85           packet:        fetch< version 2
23:54:31.948816 pkt-line.c:85           packet:        fetch< agent=git/github-26eb2912769f-Linux
23:54:31.948851 pkt-line.c:85           packet:        fetch< ls-refs=unborn
23:54:31.948857 pkt-line.c:85           packet:        fetch< fetch=shallow wait-for-done filter
23:54:31.948859 pkt-line.c:85           packet:        fetch< server-option
23:54:31.948860 pkt-line.c:85           packet:        fetch< object-format=sha1
23:54:31.948861 pkt-line.c:85           packet:        fetch< 0000
23:54:31.948865 pkt-line.c:85           packet:        fetch> command=ls-refs
23:54:31.948904 pkt-line.c:85           packet:        fetch> agent=git/2.52.0-Linux
23:54:31.948915 pkt-line.c:85           packet:        fetch> object-format=sha1
23:54:31.948916 pkt-line.c:85           packet:        fetch> 0001
23:54:31.948918 pkt-line.c:85           packet:        fetch> peel
23:54:31.948919 pkt-line.c:85           packet:        fetch> symrefs
23:54:31.948944 pkt-line.c:85           packet:        fetch> unborn
23:54:31.948966 pkt-line.c:85           packet:        fetch> ref-prefix refs/heads/
23:54:31.948970 pkt-line.c:85           packet:        fetch> ref-prefix refs/heads/fresh-start
23:54:31.948973 pkt-line.c:85           packet:        fetch> ref-prefix refs/tags/
23:54:31.948976 pkt-line.c:85           packet:        fetch> ref-prefix HEAD
23:54:31.948977 pkt-line.c:85           packet:        fetch> 0000
23:54:32.191765 pkt-line.c:85           packet:        fetch< de3f################################2de2 HEAD symref-target:refs/heads/main
23:54:32.191817 pkt-line.c:85           packet:        fetch< dcb1################################db92 refs/heads/fresh-start
23:54:32.191826 pkt-line.c:85           packet:        fetch< de3f################################2de2 refs/heads/main
23:54:32.191831 pkt-line.c:85           packet:        fetch< 0000
23:54:32.239204 run-command.c:673       trace: run_command: git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
23:54:32.239250 run-command.c:765       trace: start_command: /usr/local/libexec/git-core/git rev-list --objects --stdin --not --exclude-hidden=fetch --all --quiet --alternate-refs
23:54:32.422211 pkt-line.c:85           packet:        fetch> 0000
23:54:32.649729 run-command.c:1540      run_processes_parallel: preparing to run up to 1 tasks
23:54:32.662118 run-command.c:1568      run_processes_parallel: done
23:54:32.662151 run-command.c:673       trace: run_command: git maintenance run --auto --no-quiet --detach
23:54:32.664258 run-command.c:765       trace: start_command: /usr/local/libexec/git-core/git maintenance run --auto --no-quiet --detach
23:54:32.681796 git.c:502               trace: built-in: git maintenance run --auto --no-quiet --detach

Expected Behavior

Behave the same as vscode

Operating System

Windows 10/11

Version Information

IDE 2.4.31

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report with GIT_TRACE, it’s really helpful.

From the trace, the 60-second delay clearly happens between starting the SSH command and getting the first response from the server. This points to an issue with how SSH_AUTH_SOCK forwarding works inside the devcontainer. It’s likely SSH is first waiting for a timeout on one auth method before it falls back to another.

This is a known issue with our Dev Containers extension on Windows. The team is aware, and your report plus the trace comparison helps with prioritization.

A few things you can try as a temporary workaround:

  1. Check what echo $SSH_AUTH_SOCK shows inside the devcontainer terminal in Cursor. If it’s something like /tmp/cursor-remote-ssh-xxxx.sock instead of the expected path, that means the proxy forwarder is in use, and that’s what’s causing the problem.

  2. Try manually overriding the variable in the devcontainer terminal:

    export SSH_AUTH_SOCK=/ssh-agent
    

    (or whatever path you mount the 1Password socket to from the host), then see if git fetch becomes fast.

  3. If that works, add the variable to remoteEnv in .devcontainer.json to make it stick.

Let me know if the workaround helps, or if SSH is still slow even with a direct socket path.

Hi Dean,

  • Yes initial response is a tmp cursor socket. But this is the same as vscode which has a tmp vscode socket
  • Overriding SSH_AUTH_SOCK with ssh-agent results in:
    [email protected]: Permission denied (publickey).
    fatal: Could not read from remote repository.

I had already tried a similar approach.

When I set the SSH_AUTH_SOCK to the vscode tmp socket in the same dev container it works. But this is a bit ridiculous to require vscode open at the same time as cursor and having to override the socket manually based on the current instance.

The requirement is simple:

Cursor needs to fix it’s SSH_AUTH_SOCK forwarding to function the same as vscode

At the moment I have paid for a 1 year subscription and after 1 month, basic workflows in the IDE are not possible due to basic functionality limitations. Stop adding “features” and create a stable platform. It is currently unusable.

Got it. The workaround with /ssh-agent didn’t help. The “Permission denied” confirms the path to the 1Password agent socket is different on the host.

The fact that everything works via the VS Code temp socket is the key detail here. The issue is in our proxy forwarder. It adds about 60s of latency when establishing the SSH connection.

A couple quick questions to help us prioritize:

  1. What version of the anysphere.remote-containers extension are you on? (Extensions sidebar → find the extension → check the version)
  2. Can you run echo $SSH_AUTH_SOCK in the devcontainer terminal and share the output? I want to confirm the forwarder path matches the expected format.

I’ve forwarded the report internally. I’ll update here if I hear anything new.

vscode

  • ms-vscode-remote.remote-containers:0.442.0
  • /tmp/vscode-ssh-auth-a4d7ebab-160e-4ad6-9a40-811e39629d99.sock

cursor

  • anysphere.remote-containers: 1.0.32
  • /tmp/cursor-remote-ssh-7a953854-314f-49f7-a765-ba8dfd2985b8.sock

Hows progress? Surely seeing as there is a working example this should be a quick fix?

Bumpety bump bump.

So do I get a refund for the last 16 days since I originally emailed support (still waiting for a response btw)? Have not been able to use cursor since.

If you are going to fork an open source project, don’t break existing functionality.

OK, so how do I get a refund? This is pointless! Your product does not meet basic development requirements.