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.
Describe the bug
Everytime the socat fork executes a new instance of wsl2-ssh-pageant, an empty terminal window (Windows Terminal Preview, as it is my default terminal application, but it also happens when the normal conhost terminal is configured) opens for a second and then closes again. Should the PIN need to be put in, the window stays open until I have done so too. Because it opens in the foreground and steals input focus during its lifetime, this is moderately annoying. While this behaviour does not occur 100% of time, I am unsure which circumstances lead to the window appearing and which do not.
I believe that this has started to occur after upgrading my OS to Windows 11 (in-place upgrade, not a new installation). It also seems that the problem disappears with an upgrade of my GnuPG version (on Windows) from 2.2.28 to 2.3.4, but unfortunately this upgrade seems to break some other think regarding the YubiKey detection and Pageant connection (see e.g. #25) so I had to roll this back. As the issue was not appearing completely consistently with the old version either, it could also be that the new version is affected as well and just didn't show the behaviour during my time of experimenting with it.
I am not necessarily asserting that this is a bug with wsl2-ssh-pageant itself, it may well also be caused by my specific configuration, which is why I'm trying to provide as much information as I can below, maybe someone experiences similar issues and can see a similarity in circumstances. Also, the attached wsl2-ssh-pageant log at the bottom does contain an error, however this does not seem to impact functionality, but it might still be a possible cause?
To Reproduce
Execute any command resulting in the GPG socket's usage, e.g. ssh-add -L, gpg --card-status or just any ssh <host>
See a empty terminal window with wsl2-ssh-pageant's path as its title open up and close again immediately afterwards (or after PIN entry is complete)
Expected behavior
The execution of wsl2-ssh-pageant should not open up any window or cause any UI interaction.
Screenshots
Image of the empty Windows Terminal Preview window opening up in response to a ssh-add -L, with the executable's path set as the tab's/window's title
Desktop:
OS: Windows 11
Execution environment: Arch @ WSL2
Terminal: Windows Terminal Preview 1.12.3472.0
Software: Gpg4Win 3.1.16 & GnuPG 2.2.28
wsl2-ssh-pageant integration script
export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock"
export GPG_AGENT_SOCK="$HOME/.gnupg/S.gpg-agent"
GPG_WINDOWS_SOCKETDIR=$(gpgconf.exe --list-dirs | grep socketdir | cut -f2- -d: | tr -d '\r\n' | sed -e 's|\\|/|g' -e 's|%3a|\\:|g')
WSL2_SSH_PAGEANT_LOG_DIR="$HOME/.local/log/wsl2-ssh-pageant"
WSL2_SSH_PAGEANT_BIN="$APPDATA/wsl2-ssh-pageant/wsl2-ssh-pageant.exe"
if test -x "$WSL2_SSH_PAGEANT_BIN"; then
if ! ss -a | grep -q "$SSH_AUTH_SOCK"; then
rm -f "$SSH_AUTH_SOCK"
(setsid nohup socat UNIX-LISTEN:"$SSH_AUTH_SOCK,fork" EXEC:"$WSL2_SSH_PAGEANT_BIN --verbose --logfile $WSL2_SSH_PAGEANT_LOG_DIR/wsl2sp-ssh.log" > /dev/null 2>&1 &)
fi
if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then
rm -rf "$GPG_AGENT_SOCK"
(setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$WSL2_SSH_PAGEANT_BIN --gpg S.gpg-agent --gpgConfigBasepath $GPG_WINDOWS_SOCKETDIR --verbose --logfile $WSL2_SSH_PAGEANT_LOG_DIR/wsl2sp-gpg.log" > /dev/null 2>&1 &)
fi
else
echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable."
fi
Running socat processes (including --gpgConfigBasepath due to #26)
Hello, can you provide the version of wsl2-ssh-pageant you are using? I would assume you've used the latest release and did not built it from source?
This window popping up is a regression from Microsoft introduced with the Store version of WSL. For wsl2-ss-pageant I've already fixed this in the mainline, I will try to cut a new release. Notice that GPG also brings up the window on the first run.
Your assumption was correct, I was using version 1.3.0 through the prebuilt binary from the releases page previously.
Upgrading to version 1.4.0 you just released fixes the issue, thank you for the amazing support.
Describe the bug
Everytime the socat fork executes a new instance of wsl2-ssh-pageant, an empty terminal window (Windows Terminal Preview, as it is my default terminal application, but it also happens when the normal conhost terminal is configured) opens for a second and then closes again. Should the PIN need to be put in, the window stays open until I have done so too. Because it opens in the foreground and steals input focus during its lifetime, this is moderately annoying. While this behaviour does not occur 100% of time, I am unsure which circumstances lead to the window appearing and which do not.
I believe that this has started to occur after upgrading my OS to Windows 11 (in-place upgrade, not a new installation). It also seems that the problem disappears with an upgrade of my GnuPG version (on Windows) from 2.2.28 to 2.3.4, but unfortunately this upgrade seems to break some other think regarding the YubiKey detection and Pageant connection (see e.g. #25) so I had to roll this back. As the issue was not appearing completely consistently with the old version either, it could also be that the new version is affected as well and just didn't show the behaviour during my time of experimenting with it.
I am not necessarily asserting that this is a bug with wsl2-ssh-pageant itself, it may well also be caused by my specific configuration, which is why I'm trying to provide as much information as I can below, maybe someone experiences similar issues and can see a similarity in circumstances. Also, the attached wsl2-ssh-pageant log at the bottom does contain an error, however this does not seem to impact functionality, but it might still be a possible cause?
To Reproduce
ssh-add -L
,gpg --card-status
or just anyssh <host>
Expected behavior
The execution of wsl2-ssh-pageant should not open up any window or cause any UI interaction.
Screenshots
Image of the empty Windows Terminal Preview window opening up in response to a
ssh-add -L
, with the executable's path set as the tab's/window's titleDesktop:
wsl2-ssh-pageant integration script
Running socat processes (including --gpgConfigBasepath due to #26)
SSH agent socket wsl2-ssh-pagent log snippet
The text was updated successfully, but these errors were encountered: