You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
On the latest Windows 11 Release Preview, the agent communication consistently breaks if I close and re-open the terminal. ssh-add -l then fails with communication with agent failed.
The strange thing is, it works fine when I initially open the Terminal, and it freshly starts socat.
It also works great if I then open another terminal, while the other is still open.
However, if I close the Terminal, and then re-open it, communication with the agent becomes impossible with the above error.
Killing socat and opening another terminal(re-running the code in zshrc) fixes the issue momentarily, until I close all terminals again.
However again, if I close the Terminal and wait long enough for WSL2 to stop the VM after a minute or so, and then start a new Terminal, a new socat process is started and it works fine.
So this only happens if I somewhat quickly close and re-open the last open Terminal.
In that state, ps lists the socat process just fine, and it also appears in ss output.
I have adapted the snippet in my zshrc to account for that situation:
export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock"
ssh-add -l >/dev/null 2>&1; SSH_RES=$?
ss -a | grep -q "$SSH_AUTH_SOCK"; SS_RES=$?
if [[ $SSH_RES == 1 && $SS_RES == 0 ]]; then
pkill -f "$SSH_AUTH_SOCK"
SS_RES=1
fi
if [[ $SS_RES != 0 ]]; then
rm -f "$SSH_AUTH_SOCK"
PAGEANT_BIN="$HOME/.ssh/wsl2-ssh-pageant.exe"
if test -x "$PAGEANT_BIN"; then
(setsid nohup socat UNIX-LISTEN:"$SSH_AUTH_SOCK,fork" EXEC:"$PAGEANT_BIN" >/dev/null 2>&1 &)
else
echo >&2 "WARNING: $PAGEANT_BIN is not executable."
fi
unset PAGEANT_BIN
fi
unset SSH_RES SS_RES
But that is merely a workaround, and not an actual fix for the issue.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
On the latest Windows 11 Release Preview, the agent communication consistently breaks if I close and re-open the terminal.
ssh-add -l
then fails withcommunication with agent failed
.The strange thing is, it works fine when I initially open the Terminal, and it freshly starts socat.
It also works great if I then open another terminal, while the other is still open.
However, if I close the Terminal, and then re-open it, communication with the agent becomes impossible with the above error.
Killing socat and opening another terminal(re-running the code in zshrc) fixes the issue momentarily, until I close all terminals again.
However again, if I close the Terminal and wait long enough for WSL2 to stop the VM after a minute or so, and then start a new Terminal, a new socat process is started and it works fine.
So this only happens if I somewhat quickly close and re-open the last open Terminal.
In that state,
ps
lists the socat process just fine, and it also appears inss
output.I have adapted the snippet in my zshrc to account for that situation:
But that is merely a workaround, and not an actual fix for the issue.
The text was updated successfully, but these errors were encountered: