I'm using a long running tmux session on my workstation. Sometimes I have to connect to this workstation by ssh from my laptop. I take my ssh private key stored on a YubiKey with me. Means the Yubikey is connected to the Workstation or to the laptop. To use ssh inside of tmux I have to manage the SSH_AUTH_SOCK environment variable to connect to the right ssh-agent.
for new windows I have already implemented the 'update-environment' solution I found here:
set -ga update-environment "SSH_AUTH_SOCK"
to update the environment of already running sessions I'm looking for any type of shortcut, alias or script.
How can I identify a pid or the tty of the parrent session I'm currently connected to tmux to select the right ssh-agent socked? Or is there a tmux command to update the "SSH_AUTH_SOCK" variable manual?