Been playing with that thought for a while now, finally got to rebuilding it for lenny, now I’m using it… tmux is the new screen. To have fun already I read a few short introductions and got myself a few suggestions for a proper .tmux.conf. So, for root I have this one now:

# Copy mode
unbind [
bind Escape copy-mode

# Use Vi mode
setw -g mode-keys vi

# Make mouse useful in copy mode
setw -g mode-mouse on

# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind h split-window -h
unbind '"'
bind - split-window -v
bind v split-window -v

# History
set -g history-limit 4000

# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'

# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left '#[fg=green]#H#[default]'
# no line break here, it's just to long for my blog layout!
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'

# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on

# Highlighting the active window in status bar
setw -g window-status-current-bg red

# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24

# Create a default session
new -n htop -d htop
setw -t htop monitor-activity off
neww -n aptitude -d aptitude
neww -d

Then I added a new alias to my user’s zsh config:

alias root='su -c "tmux attach"'

Why ‘tmux attach’? Because tmux would start a new session which I don’t want it to. The config already starts a session which we can immediately attach to. Also, when such session was started I can attach to it as a user with the very same command over and over again. That makes it pretty handy as I always have htop, aptitude and a free shell available in a nice tmux session. Great. How did I live until now? ;-)

4 Comments

  1. jhr says:

    One more thing about it:

    tmux also allows splitting screens. Such panes can be arranged almost randomly. And one cool thing I just found is:

    set mouse-select-pane on

    which allows, as the option suggests, selecting the active pane with your mouse. It’s getting better and better…

  2. meillo says:

    … if it does not start suffering from featuritis. :-/

  3. jhr says:

    That happened to you?

  4. garmin 1490t says:

    I’m not certain that I agree 100% with your blog post, but I did find it intriguing.

Leave a Reply

*