Created
July 18, 2015 17:35
-
-
Save christianmlong/bf261540c67585ea36c4 to your computer and use it in GitHub Desktop.
Synchronise tmux's ssh env variables after reconnection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sync the environment of an existing shell | |
# | |
# tmux already updates the environment according to | |
# the update-environment settings in the config. However | |
# for existing shells you need to sync from from tmux's view | |
# of the world. | |
function tmux_sync_env | |
{ | |
ssh_auth_sock=`tmux showenv | grep "^SSH_AUTH_SOCK"` | |
ssh_connection=`tmux showenv | grep "^SSH_CONNECTION"` | |
export ${ssh_auth_sock} | |
export "${ssh_connection}" | |
} | |
alias tse='tmux_sync_env' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment