add wsl ssh agent support

main
Andrew Coleman 2024-02-05 12:44:47 -05:00
parent bc2a758c95
commit 151f134703
1 changed files with 10 additions and 0 deletions

10
.zshrc
View File

@ -116,4 +116,14 @@ if command -v zoxide > /dev/null ; then
eval "$(zoxide init zsh)"
fi
if [[ "$(uname -r)" =~ "microsoft" ]] ; then
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
else
export SSH_AGENT_PID=$(pgrep ssh-agent)
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name "agent.*")
fi
fi
[ -f "$HOME/.zshrc.local" ] && source "$HOME/.zshrc.local"