fix ssh agent on wsl
This commit is contained in:
parent
024078ceab
commit
9897fd2a4d
12
.zshrc
12
.zshrc
|
@ -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() {}
|
||||
|
|
Loading…
Reference in New Issue