Favorite commands

  • Create session: tmux new [-s <session name>]
  • Detach session: Ctrl + b, d
  • Attach session: tmux a -t <session name>
  • Rename session (while in it): Ctrl + b, $
  • List sessions: tmux ls OR Ctrl + b, s
  • Kill session: tmux kill-session -t <session name>
  • Go to previous session: Ctrl + b, (
  • Go to next session: Ctrl + b, )

Scrolling

  • Scroll session: Ctrl + B + [ Page Up | Page Down ]
  • Enable scroll mode: Ctrl + b, [
  • Exit scroll mode: q

Panes

  • Move pane left/right: Ctrl + B + [ { | } ]
  • Toggle between pane layouts: Ctrl + b + spacebar
  • Split window into panes vertically: Ctrl + b + "
  • Split window into panes horizontally: Ctrl + b + %
  • Kill pane: Ctrl + b + x
  • Switch to pane to the direction: Ctrl + b + <arrow key>

Helpful websites

Sharing a TMUX session across user accounts

  1. Create new session: tmux -S /tmp/shareds new -s shared
  2. Have them connect: sudo tmux -S /tmp/shareds attach -t shared

Source: https://www.howtoforge.com/sharing-terminal-sessions-with-tmux-and-screen

Increase scrollback buffer

vi ~/.tmux.conf set-option -g history-limit 9999