From fc2b3d4239c52b5c99c0292072e6b197a231436c Mon Sep 17 00:00:00 2001 From: Naman Sood Date: Sat, 12 Mar 2022 21:53:14 -0500 Subject: [PATCH] zshrc: load ssh identities in WSL2 Signed-off-by: Naman Sood --- zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zshrc b/zshrc index e292eb3..9b1943d 100644 --- a/zshrc +++ b/zshrc @@ -105,3 +105,8 @@ source $ZSH/oh-my-zsh.sh [[ ! -r /home/nsood/.opam/opam-init/init.zsh ]] || source /home/nsood/.opam/opam-init/init.zsh > /dev/null 2> /dev/null +# fix for WSL not starting ssh-agent on boot +if [ -z "$SSH_AUTH_SOCK" ] ; then + eval `ssh-agent -s` + grep -slR PRIVATE ~/.ssh/ | xargs ssh-add +fi