-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Remote-SSH Bug]: Cannot reconnect to ssh agent in the same terminal after reload window #7859
Comments
sorry for the delay- I'm going to attempt to repro. Thanks |
Hello! I think this is related to an ongoing issue we have with useLocalServer where it is not actually reusing the local server correctly. We are aware of this issue and plan to get it fixed soon so hopefully this will be the fix. You can follow along here #6227 and I will keep this open while the issue is not yet addressed. |
Anyone coming here wanting a quick fix, I've done the following which works on my machine (vscode on mac, running remote on linux) I've added the following line to my remote
What this does is, check if the symlink in $SSH_AUTH_SOCK is pointing to a socket, if not it takes the last created agent socket and links to it. Validate with Just my 2c Edit: I noticed that on a regular login $SSH_AUTH_SOCK points to a socket and not a symlink. Therefore the following works better. Also, this takes into account that $SSH_AUTH_SOCK just points to a file that's just not there # vscode SSH_AUTH_SOCK fix
(test -L $SSH_AUTH_SOCK && (
test -S $(readlink $SSH_AUTH_SOCK) && \
ln -sf $(ls -1rtd /tmp/ssh-*/* | tail -1 | xargs) $SSH_AUTH_SOCK
)) || ln -sf $(ls -1rtd /tmp/ssh-*/* | tail -1 | xargs) $SSH_AUTH_SOCK |
i tried the quickfix, but this didn't work out of the box, because the symlink could not be created (i didnt look into the matter deeper, tho) instead, i added to my .bashrc the following: |
My solution
|
Is there an existing issue for this bug?
Debugging Steps
remote.SSH.useLocalServer
setting->
remote.SSH.useLocalServer=false
does not have this issue.Versions
Expected Behavior
Cannot reconnect to ssh agent in the same terminal after reload window.
Steps To Reproduce
remote.SSH.useLocalServer=true
Remote-SSH Log
Remote-SSH Log when reloading the window
Anything else?
This issue also occurs when the ssh connection has been lost, but vscode hasn't quit, and you reconnect by reloading the window.
The text was updated successfully, but these errors were encountered: