Skip to content

Commit

Permalink
Update SSH auth socket inside tmux sessions. Disable GPG agent for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
ammmir committed Sep 13, 2016
1 parent aacac47 commit df10b0b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@ if [ -f "${HOME}/.gpg-agent-info" ]; then
export SSH_AGENT_PID
fi

. "${HOME}/dot-files/gpg-agent-startup"
#. "${HOME}/dot-files/gpg-agent-startup"

# update SSH agent socket inside tmux sessions
update_ssh_agent_sock () {
if ((SECONDS/120 > __last_sock_update)); then
((__last_sock_update = SECONDS/120))
eval $(tmux show-env | grep '^SSH_AUTH_SOCK')
fi
}

if { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
PROMPT_COMMAND="update_ssh_agent_sock; $PROMPT_COMMAND"
fi

0 comments on commit df10b0b

Please sign in to comment.