fix ssh agent on wsl

This commit is contained in:
Em 2020-08-10 08:23:11 -04:00
parent 024078ceab
commit 9897fd2a4d
1 changed files with 12 additions and 0 deletions

12
.zshrc
View File

@ -70,4 +70,16 @@ alias getunicode="perl -C7 -ne 'for(split(//)){print sprintf(\"U\+\%04X\", ord).
alias mkenv="python3.7 -m venv .env && source .env/bin/activate"
alias senv="source .env/bin/activate"
if [ -z "$SSH_AUTH_SOCK" ]
then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]
then
# Launch a new instance of the agent
ssh-agent -s &> ~/.ssh/ssh-agent
fi
eval `cat ~/.ssh/ssh-agent`
fi
prompt_context() {}