tmux is a powerful terminal multiplexer, and with a proper configuration file, you can significantly enhance your experience.

  1. Create the configuration file
    touch ~/.tmux.conf
  2. Edit the configuration file
    ~/.tmux.conf
    # Enable mouse support
    set -g mouse on
  3. Apply the configuration
    tmux source-file ~/.tmux.conf

I prefer to add some aliases so I don’t have to remember its complex commands.

~/.bashrc
# tmux
alias tls='tmux ls'
alias tn='tmux new -s'
alias ta='tmux attach -t'
alias tk='tmux kill-session -t'

For quickly check the tmux shortcuts, see the tmux cheatsheet.