News for hackers. Stuff that matters.
Re:A Quick and Easy Guide to Tmux (2015) by 1996 on Tuesday October 29, 2019 @03:59PM (#21391355)
Suggestion for your bash_login or equivalent, to automatically get back your session based on the IP you connect from (6to4 safe):

REMOTEIP=`echo $SSH_CONNECTION |sed -e 's/::ffff://g' -e 's/ .*//g'`

if [ -z "$SSH_CONNECTION" ]; then if [ "$TERM" != "tmux" ]; then tmux attach -t $REMOTEIP || tmux new -s $REMOTEIP ; fi ; fi

I have static IPs and I like to come back to a server the way I left it the day before, from home or work.

For pratical reasons (everything in one window), I often have tmux running inside GNU screen, with one GNU screen per remote server.

There are no comments on this comment yet.