Fix ssh auth sock in tmux

This commit is contained in:
Hunter Haugen 2014-04-10 14:22:01 -07:00
parent 75f345f83b
commit 72c155a7b8
2 changed files with 6 additions and 3 deletions

View file

@ -20,3 +20,5 @@ helper = /opt/boxen/bin/boxen-git-credential
[hub] [hub]
protocol = https protocol = https
[gitreview]
username = hunner

View file

@ -182,8 +182,9 @@ alias gvim="gvim -font 'APL385 Unicode 8' -c 'set keymap=uniapl385'"
alias n=nvim alias n=nvim
## For forwarding ssh auth I think ## For forwarding ssh auth I think
if [ -n "$SSH_AUTH_SOCK" ] ; then if [ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$HOME/.ssh-agent" ] ; then
ln -fs $SSH_AUTH_SOCK $HOME/.ssh-agent ln -fs $SSH_AUTH_SOCK "$HOME/.ssh-agent"
export SSH_AUTH_SOCK="$HOME/.ssh-agent"
fi fi
## Add extra fonts ## Add extra fonts
@ -352,7 +353,7 @@ zpush() {
} }
function r() { function r() {
if [[ -n $TMUX ]]; then if [[ -n $TMUX ]]; then
NEW_SSH_AUTH_SOCK=`tmux showenv|grep ^SSH_AUTH_SOCK|cut -d = -f 2` NEW_SSH_AUTH_SOCK=`tmux showenv|grep '^SSH_AUTH_SOCK'|cut -d = -f 2`
if [[ -n $NEW_SSH_AUTH_SOCK ]] && [[ -S $NEW_SSH_AUTH_SOCK ]]; then if [[ -n $NEW_SSH_AUTH_SOCK ]] && [[ -S $NEW_SSH_AUTH_SOCK ]]; then
SSH_AUTH_SOCK=$NEW_SSH_AUTH_SOCK SSH_AUTH_SOCK=$NEW_SSH_AUTH_SOCK
fi fi