Skip to content

Instantly share code, notes, and snippets.

@leonjza
Created March 16, 2015 11:08
Show Gist options
  • Save leonjza/a09da92fd64b46c35f73 to your computer and use it in GitHub Desktop.
Save leonjza/a09da92fd64b46c35f73 to your computer and use it in GitHub Desktop.
Update Tmux SSH_AUTH_SOCK
update_auth_sock() {
local socket_path="$(tmux show-environment | sed -n 's/^SSH_AUTH_SOCK=//p')"
if ! [[ "$socket_path" ]]; then
echo 'no socket path' >&2
return 1
else
export SSH_AUTH_SOCK="$socket_path"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment