Created
November 20, 2019 22:05
-
-
Save deg0nz/b072568cc62190bd3eedf6c7c6b7b284 to your computer and use it in GitHub Desktop.
Start tmux session on SSH login or attach to existing session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy this gist to
~/.config/fish/conf.d/tmux.conf