Skip to content

Instantly share code, notes, and snippets.

@deg0nz
Created November 20, 2019 22:05
Show Gist options
  • Save deg0nz/b072568cc62190bd3eedf6c7c6b7b284 to your computer and use it in GitHub Desktop.
Save deg0nz/b072568cc62190bd3eedf6c7c6b7b284 to your computer and use it in GitHub Desktop.
Start tmux session on SSH login or attach to existing session
if begin
not set -q TMUX
and set -q SSH_CONNECTION
end
set WHOAMI (whoami)
if tmux has-session -t $WHOAMI
tmux -2 attach-session -t $WHOAMI
else
tmux -2 new-session -s $WHOAMI
end
end
@deg0nz
Copy link
Author

deg0nz commented Nov 20, 2019

Copy this gist to ~/.config/fish/conf.d/tmux.conf

@deg0nz
Copy link
Author

deg0nz commented Nov 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment