Tmux is a great tool to increase productivity in a unix shell environment. Tmux or Terminal multiplexer allows you to use multiple sessions, windows, panes and more. Unfortunately, remembering all the commands can be a bit difficult for a beginner. Below is a quick reference from the book Tmux: Productive Mouse-Free Development

For Future Reference

Creating Sessions

Command Description

  • tmux new-session Creates a new session without a name. Can be shortened to tmux new or simply tmux.
  • tmux new -s development
    Creates a new session called “development.”
  • tmux new -s development -n editor
    Creates a session named “development” and names the first window “editor.”
  • tmux attach -t development
    Attaches to a session named “development.”

Default Commands for Sessions, Windows, and Panes

  • Prefix d
    Detaches from the session, leaving the session running in the background.
  • Prefix :
    Enters Command mode.
  • Prefix c
    Creates a new window from within an existing tmux session. Shortcut for new-window.
  • Prefix 0…9
    Selects windows by number.
  • Prefix w
    Displays a selectable list of windows in the current session.
  • Prefix ,
    Displays a prompt to rename a window.
  • Prefix &
    Closes the current window after prompting for confirmation.
  • Prefix %
    Divides the current window in half vertically.
  • Prefix "
    Divides the current window in half horizontally.
  • Prefix o
    Cycles through open panes.
  • Prefix q
    Momentarily displays pane numbers in each pane.
  • Prefix x
    Closes the current pane after prompting for confirmation.
  • Prefix Space
    Cycles through the various pane layouts.