I use keychain
from funtoo which helps
re-using ssh-agent.
But I had an isssue from time to time, the $SSH_AUTH_SOCK
would be unset.
It seems there is an issue with Universal fish variable which keychain
uses.
The workaround is to copy those variables to global ones, like so in your
config.fish
.
if status --is-interactive
keychain --agents ssh --eval --quiet --inherit any -Q | source
# Make those variables global to avoid universal version override
set -xg SSH_AUTH_SOCK $SSH_AUTH_SOCK
set -xg SSH_AGENT_PID $SSH_AGENT_PID
end
This ensure that setting those variables in other terminals will not mess them up.