GNU Screen and Tmux: tips and tricks

gnu-screentmux

So I am a big fan of the multiplexers like GNU Screen and Tmux, but even using Screen for years now I still recognize that there are many things there I don't know (and I only use Tmux for a couple of months so its worse).

What configs and tips and tricks you use on those software (both or on each one, doesn't matter)?

I use this as my screen config (I think I adapted this from Ubuntu's default screenrc):

shell -$SHELL
startup_message off
defscrollback 1000
hardstatus alwayslastline '%{= wk}%?%-Lw%?%{r}(%{k}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %m/%d %C%A'
activity ''
termcapinfo xterm* 'hs:ts=\\E]2;:fs=\\007:ds=\\E]2;screen\\007'

It's a simple config to keep the status bar showing with some colors, but I am sure that there are more things I can do with screen and Tmux and would love to know it.

Best Answer

This may be a bit simple for this crowd, but I found it useful to add this to the end of .profile, so that when I log in remotely via ssh, I get to read the MOTD, then switch to screen.

if [ -n "$SSH_TTY" ]
then
        read -p "Press <ENTER> to continue." enterkey
        exec /usr/bin/screen -D -R
fi