Skip to content

Instantly share code, notes, and snippets.

@st3fan
Created January 11, 2025 21:28
Show Gist options
  • Save st3fan/99f5fd8566f09709670798b206e636f1 to your computer and use it in GitHub Desktop.
Save st3fan/99f5fd8566f09709670798b206e636f1 to your computer and use it in GitHub Desktop.
SSH & Tmux

This is ~/.ssh/rc

#!/bin/sh

if [ -n "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then
  ln -sf "$SSH_AUTH_SOCK" "$XDG_RUNTIME_DIR/.ssh-agent.socket"
fi

This is ~/.config/fish/conf.d/ssh.fish

if status is-interactive
    if set -q SSH_AUTH_SOCK and set -q XDG_RUNTIME_DIR
        if test -e "$XDG_RUNTIME_DIR/.ssh-agent.socket"
            set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/.ssh-agent.socket"
        end
    end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment