From 2e0d54d73f934bd93947a1be5e694afecee78501 Mon Sep 17 00:00:00 2001 From: kageru Date: Sat, 21 Jul 2018 17:45:24 +0200 Subject: [PATCH] fix ssh-agent in zshrc --- .zshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 840924f..b10ec45 100644 --- a/.zshrc +++ b/.zshrc @@ -38,11 +38,17 @@ export WINEDEBUG=-all # Get completion above command line setopt noalwayslastprompt -setopt noauto_remove_slash setopt list_types setopt complete_in_word -export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" +if [ ! -S ~/.ssh/ssh_auth_sock ]; then + eval `ssh-agent` + ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock +fi +export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock +ssh-add -l > /dev/null || ssh-add +ssh-add ~/.ssh/git +clear # disclaimer: I blatantly copied all of this without actually knowing what it does. ¯\_(ツ)_/¯