Skip to content

Commit

Permalink
Fix SSH_AUTH_SOCK and tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
statico committed Sep 30, 2024
1 parent 3414805 commit 8345aac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ set -g @continuum-restore 'on'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

# Fix ssh agent when tmux is detached
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
11 changes: 9 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ alias gsmu='git submodule update --init --recursive'
alias gss='git show -p --stat'
alias gt='git tag'
alias gu='git unstage'
alias gundo='git undo'
alias gup='git up'
alias gus='git unstage'
alias gvc='vim `git diff --name-only --diff-filter=U`'
Expand All @@ -210,6 +211,7 @@ alias iurl='xcrun simctl openurl booted'
alias jqi='_jqi () { echo "" | fzf --print-query --preview "cat $@ | jq {q}" }; _jqi'
alias k='tree -h'
alias l="ls -lh"
alias lg='l --git'
alias ll="l -a"
alias lt='ls -lt'
alias ltr='ls -ltr'
Expand Down Expand Up @@ -389,8 +391,8 @@ randpass() {

# Latest file in a directory or that matches a pattern.
latest() {
if _has exa ; then
exa -r -sold --oneline $@ | tail -n1
if _has eza ; then
eza -r -sold --oneline $@ | tail -n1
else
ls -ltr1 $@ | tail -n1
fi
Expand Down Expand Up @@ -783,6 +785,11 @@ if [ -e "$HOME/.ssh/config" -a ! -e "$HOME/.ssh/skip-host-aliases" ]; then
done
fi

# Fix SSH auth socket location so agent forwarding works with tmux.
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi

# FZF {{{1

for dir in ~/.fzf /usr/share/fzf /usr/local/opt/fzf/shell /opt/homebrew/opt/fzf/shell ; do
Expand Down

0 comments on commit 8345aac

Please sign in to comment.