Start ssh agent everywhere.

This commit is contained in:
Bartek Stalewski 2021-09-06 12:37:22 +02:00
parent 605d89896f
commit a3ca6e4701
2 changed files with 9 additions and 0 deletions

6
zsh/ssh.zsh Normal file
View file

@ -0,0 +1,6 @@
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > "$XDG_CACHE_HOME/ssh-agent.env"
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
source "$XDG_CACHE_HOME/ssh-agent.env" >/dev/null
fi