Always use tmux with ssh
Put this in your .zshrc
/.bashrc
function ssht(){
ssh $* -t 'tmux a || tmux || /bin/bash'
}
Now
$ ssht user@host
will attach to existing tmux session, create new if one does not exist or just start bash if there is no tmux available.
Written by Tymon Tobolski
Related protips
2 Responses

Love this tip, a small adjustment I made was to use the users default shell (where it isn't /bin/bash):
getent passwd $LOGNAME | cut -d: -f7
over 1 year ago
·

@teamon and then you're just one step away from what I consider to be the ideal ssh+tmux setup: http://goo.gl/XumZS9
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ssh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#