Hey so what if you wanted tmux or screen to pop open your session every time you log in, and then automatically log you out when you detach?!
That'd be pretty convenient.
Here add this to your ~/.bash_profile
:
[[ $TERM != "screen" ]] && tmux att && exit
Feel free to substitute tmux att
with screen -r
if you're in that camp. I don't judge.
Cool.
Now go ahead and detach, log out, then log back in.
MAGIC I TELL YOU. MAGIC.
Thanks.
I think this might be a better check:
I don't know the equivalent for
screen
. (Also, when you are tinkering with ~/.bash_profile (especially with an 'exit', you should log in from a new terminal before you close your editor. If you goof you might lock yourself out.)