From 8345aac4b1704e210468c0ffbae1cdf9f380b308 Mon Sep 17 00:00:00 2001 From: Ian Langworth Date: Mon, 30 Sep 2024 07:55:07 -0700 Subject: [PATCH] Fix SSH_AUTH_SOCK and tmux --- .tmux.conf | 3 +++ .zshrc | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 78f0094a..e41c9bf0 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -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 diff --git a/.zshrc b/.zshrc index 0aa5de90..25018612 100644 --- a/.zshrc +++ b/.zshrc @@ -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`' @@ -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' @@ -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 @@ -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