When a new ssh session to an existing tmux session is opened the
ssh-agent forwarding will use a new SSH_AUTH_SOCK path. This env
variable is updated within the tmux session, but running applications
will need to update it themselves.
Really this should be done automatically.
--- /dev/null
+function! <SID>UpdateTmuxEnv()
+ let env = trim(system("tmux showenv SSH_AUTH_SOCK"))
+ let es = split(env, "=")
+ call setenv(es[0], es[1])
+endfunction
+
+command! -nargs=0 UpdateTmuxEnv call <SID>UpdateTmuxEnv()