Si Beaumont
2015-03-31 07:56:15 UTC
When running multiple sessions and also changing host environment frequently,
it can become troublesome to keep the environment up to date within tmux.
For example if one SSHs in from a different location, the SSH_AUTH_SOCK will
change. This is solved by the update-environment command and can be
conveniently used in a bash alias to go and update the shell of the process
within tmux. E.g.
https://github.com/simonjbeaumont/.dotfiles/blob/master/bash/functions#L66-L78
The only issue is that the environment within tmux is only updated upon
attaching to a session. So the first session to which I "tmux at -t <session>"
to after an SSH will haven its environment updated but no others. If I switch
sessions using the tree choose view, the environment is not updated. The only
way is for me to attach and detach from each session in turn when my host
environment changes.
This patch causes the environment to be updated on switching sessions and
inherits the environment from the session from which you're switching.
I've been running this for a while and it seems to do the right thing.
--
Si
it can become troublesome to keep the environment up to date within tmux.
For example if one SSHs in from a different location, the SSH_AUTH_SOCK will
change. This is solved by the update-environment command and can be
conveniently used in a bash alias to go and update the shell of the process
within tmux. E.g.
https://github.com/simonjbeaumont/.dotfiles/blob/master/bash/functions#L66-L78
The only issue is that the environment within tmux is only updated upon
attaching to a session. So the first session to which I "tmux at -t <session>"
to after an SSH will haven its environment updated but no others. If I switch
sessions using the tree choose view, the environment is not updated. The only
way is for me to attach and detach from each session in turn when my host
environment changes.
This patch causes the environment to be updated on switching sessions and
inherits the environment from the session from which you're switching.
I've been running this for a while and it seems to do the right thing.
--
Si