Make your tmux look and work better
I love using tmux. Besides the excellent scripting support (see my other post ), tmux is quite easy to customize to fit your need.
Here’s my tmux config: https://github.com/midnightcodr/my_tmux_conf/blob/master/.tmux.conf
1. Credit goes to http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
2. I found using different color settings the most effect way to avoid accidental mistakes when working with test and production server, for example for production environment I use white on red (convenient color for caution?) for the current window tab color, for test environment I use black on yellow for the same element.
Feed-backs and comments are welcome!
[ UPDATE 6/6/2012 ] Finally I came up with the following status line that works on both Mac OSX and Linux regardless what the output of command uptime is:
set -g status-right '#[fg=yellow]#(uptime | egrep -o "[0-9]+ users?, +load.*"|perl -pe "s| averages?||"), %H:%M'
The challenge I found setting tmux status with command lines is that group capturing regex won’t work with tmux. For example, the following config
set -g status-right '#[fg=yellow]#(uptime|perl -pe "s#.*,(\s+\d+ users.*)#\1#;s# averages?##"), %H:%M'
would end up
1saverages?#"), 23:44 showing in the status bar (right corner).