diff --git a/files/shell/.shellrc.alias b/files/shell/.shellrc.alias index 48ba711..25616e7 100644 --- a/files/shell/.shellrc.alias +++ b/files/shell/.shellrc.alias @@ -48,6 +48,11 @@ alias ls='ls --color --hyperlink' alias nssh='SSH_AUTH_SOCK= ssh' alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE` t() { + # if remote, link agent so a stale env doesn't hurt agent + if [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]] || [[ $SSH_AUTH_SOCK =~ "$HOME/.ssh/agent" ]]; then + ln -sf $SSH_AUTH_SOCK /tmp/agent.sock + export SSH_AUTH_SOCK=/tmp/agent.sock + fi tmux new-session -A -s ${1:-tmux} } z() {