From: Alexander Barton Date: Thu, 5 Sep 2019 14:57:24 +0000 (+0200) Subject: ssh: Look for SSH "auth socket" in common locations X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ax-zsh.git;a=commitdiff_plain;h=1b2523083ee476870ddb30eaa95a0cf1d8dd816f;ds=sidebyside ssh: Look for SSH "auth socket" in common locations --- diff --git a/default_plugins/ssh/ssh.zshrc b/default_plugins/ssh/ssh.zshrc index 830390f..1afc7f4 100644 --- a/default_plugins/ssh/ssh.zshrc +++ b/default_plugins/ssh/ssh.zshrc @@ -27,6 +27,19 @@ ax_hostname_prompt_functions=($ax_hostname_prompt_functions _ax_ssh_prompt) # file becomes invalid when the session has been disconnected. [[ ! -r "$SSH_AUTH_SOCK" ]] && unset SSH_AUTH_SOCK +# Look for common socket locations ... +if [[ -z "$SSH_AUTH_SOCK" ]]; then + for s ( + /mnt/c/Local/$LOGNAME/ssh-agent.sock + ); do + if [[ -r "$s" ]]; then + export SSH_AUTH_SOCK=$s + break + fi + done + unset s +fi + # Save SSH environment when available: if [[ -n "$SSH_AUTH_SOCK" && -d "$XDG_RUNTIME_DIR" ]]; then # Save current environment when no state exists or is invalid.