GNU Screen & tmux — the essentials + config (2025-03-04)

Here is a starter ~/.tmux.conf:

# Enable mouse mode: scroll, resize, select panes with mouse
set -g mouse on
set -g history-limit 100000
setw -g mode-keys emacs

# --- Change prefix to Ctrl + ` ---
unbind C-b
set -g prefix `
bind ` send-prefix

# --- Disable internal clipboard forwarding ---
unbind -T copy-mode-vi y
bind -T copy-mode-vi y send -X copy-selection-and-cancel

# --- Smooth scrolling ---
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -as terminal-features ',xterm-256color:RGB'

bind -n WheelUpPane if-shell -F "#{pane_in_mode}" "send-keys -M" "copy-mode -e; send-keys -M"
bind -n WheelDownPane if-shell -F "#{pane_in_mode}" "send-keys -M" "send-keys -M"

# --- Status bar appearance ---
set -g status-bg colour235
set -g status-fg white
set -g status-left ' #[fg=green]#(hostname | cut -d"." -f1)  #[fg=yellow]|#[default]'
set -g status-right '#[fg=cyan]%Y-%m-%d #[fg=green]%H:%M #[default]'

Historic Context

Terminal Multiplexers — Command Prefix Summary

GNU Screen

  • Default prefix: Ctrl-a
  • Role: Command leader for all Screen actions
  • Invocation pattern: Ctrl-a<command>

Common commands:

  • Ctrl-a c — Create new window
  • Ctrl-a n — Next window
  • Ctrl-a d — Detach session

tmux

  • Default prefix: Ctrl-b
  • Role: Command leader for all tmux actions
  • Invocation pattern: Ctrl-b<command>

Common commands:

  • Ctrl-b c — Create new window
  • Ctrl-b n — Next window
  • Ctrl-b d — Detach session
  • Ctrl-b % — Vertical split
  • Ctrl-b " — Horizontal split

In a nutshell

  • GNU Screen: Ctrl-a (historic, canonical)
  • tmux: Ctrl-b (chosen to avoid Screen conflict)