Frequently Asked Question

tmux Cheat Sheet
Last Updated about an hour ago

tmux Cheat Sheet

tmux Cheat Sheet

Quick Reference for Ctrl+B Commands

  • Ctrl+B then ? – Show help menu of available key bindings.
  • Ctrl+B then c – Create a new window.
  • Ctrl+B then n – Move to the next window.
  • Ctrl+B then p – Move to the previous window.
  • Ctrl+B then " – List all windows in the current session.
  • Ctrl+B then % – Split the current pane vertically.
  • Ctrl+B then " – Split the current pane horizontally.
  • Ctrl+B then x – Kill the current pane.
  • Ctrl+B then d – Detach the session (leave it running in the background).
  • Ctrl+B then : – Enter tmux command prompt.
  • Ctrl+B then [ – Enter copy mode (use arrow keys or vim‑style keys to scroll).
  • Ctrl+B then ] – Paste the most recent copy.
  • Ctrl+B then : followed by set -g mouse on – Enable mouse support for resizing and selecting panes.

Common Operations & Features

   tmux new -s mysession
  1. Start a new session
   tmux ls
  1. List all sessions
   tmux attach -t mysession
  1. Attach to a running session
  1. Rename the current window
  • Inside tmux: Ctrl+B then , (type new name and press Enter).
  • Or from shell: tmux rename-window newname.
  1. Kill a window or pane
  • Window: Ctrl+B then & (confirm kill).
  • Pane: Ctrl+B then x.
  1. Resize panes (when mouse is enabled or using arrow keys)
  • Ctrl+B then Alt+Arrow (or Ctrl+B : resize-pane -L 5 etc.).
  1. Synchronize panes (send same input to all panes)
  • Ctrl+B then : set-window-option synchronize-panes on
  • To disable: replace on with off.
  1. Switch between sessions quickly
  • Ctrl+B then s – choose from a list of sessions.
  1. Detach other clients (keep your session alive while disconnecting others)
  • Ctrl+B then D.
    tmux source-file ~/.tmux.conf
  1. Reload configuration file

Tips for Efficient Use

  set -g mouse on
  bind-key -n C-a send-prefix
  • Create a .tmux.conf in your home directory to customise key bindings and enable mouse support:
  • Use session names that describe the work context (e.g., dev, prod, lab) for quick identification.
  • Split panes to run multiple commands side‑by‑side without leaving tmux.
  • Leverage copy mode (Ctrl+B [) to search within output using Ctrl+F or /pattern.
  • Persist work across terminal disconnects by using tmux detach and later attach.

What to Check Next

  • If a command isn’t working, verify that you’re inside a tmux session (echo $TERM should show screen or tmux).
  • Ensure your .tmux.conf isn’t overriding any of the default key bindings you rely on.
  • Check for any custom aliases or scripts that might interfere with tmux key sequences.
This FAQ was generated and/or edited by GAIN, GENs Artificial Intelligence Network and should not be considered 100% accurate. Always check facts and do your research, things change all the time. If you are unsure about any information provided, please raise a support ticket for clarification.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...