[zsh] Attempt to make establishing an ssh-agent session more robust
I don't think this quite works though.
This commit is contained in:
parent
fc3c6261e6
commit
f3be935075
1 changed files with 6 additions and 2 deletions
8
zprofile
8
zprofile
|
@ -3,8 +3,12 @@
|
|||
|
||||
# Start SSH agent for password-less logins
|
||||
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
|
||||
eval `ssh-agent -s`
|
||||
trap "kill $SSH_AGENT_PID" 0
|
||||
if ! pgrep -u $USER ssh-agent 1>/dev/null; then
|
||||
eval $(ssh-agent -s > ~/.ssh_agent_vars)
|
||||
trap "kill $SSH_AGENT_PID" 0
|
||||
else
|
||||
eval $(cat ~/.ssh_agent_vars)
|
||||
fi
|
||||
fi
|
||||
|
||||
autoload list_tmux_sessions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue