]> arthur.barton.de Git - ax-zsh.git/commitdiff
ssh: Make sure that XDG_RUNTIME_DIR is set & valid
authorAlexander Barton <alex@barton.de>
Mon, 10 Apr 2017 09:03:02 +0000 (11:03 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 10 Apr 2017 09:03:02 +0000 (11:03 +0200)
default_plugins/ssh/ssh.zshrc

index 234459f38663eec2b29b1668bb45da4da8f99f9e..c7f5c856527bdfd0edfd7a5d75ae96a6e0ab8441 100644 (file)
@@ -27,7 +27,7 @@ ax_hostname_prompt_functions=($ax_hostname_prompt_functions _ax_ssh_prompt)
 [[ ! -r "$SSH_AUTH_SOCK" ]] && unset SSH_AUTH_SOCK
 
 # Save SSH environment when available:
-if [[ -n "$SSH_AUTH_SOCK" ]]; then
+if [[ -n "$SSH_AUTH_SOCK" && -d "$XDG_RUNTIME_DIR" ]]; then
        # Save current environment when no state exists or is invalid.
        if [[ -r "$XDG_RUNTIME_DIR/ssh-env.sh" ]]; then
                (