diff --git a/dot_bashrc.d/wsl-ssh-agent.sh.tmpl b/dot_bashrc.d/wsl-ssh-agent.sh.tmpl new file mode 100644 index 0000000..16e29fe --- /dev/null +++ b/dot_bashrc.d/wsl-ssh-agent.sh.tmpl @@ -0,0 +1,11 @@ +{{- if (eq .chezmoi.os "linux") -}} +{{- if (contains "microsoft" .chezmoi.kernel.osrelease) -}} +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 +{{- end -}} +{{- end -}}