learntmux.dev
LEVEL 2 · INTERMEDIATE

Rename, zoom, resize, kill, layouts, tree mode, the command prompt.

Shape a workspace: rename sessions and windows, zoom and resize panes, apply layouts, and drive tmux from its own command prompt.

12 tasks · about 48 minutes · 30 key bindings

Start with task 1
  1. 01

    Change the current window

    3 min

    Jump to windows by index, step through them with next and previous, and bounce to the last window.

    C-bthen3C-bthennC-bthenl
  2. 02

    Rename the session and a window

    3 min

    Give the default session 0 and its window meaningful names using the rename prompts.

    C-bthen$C-bthen,
  3. 03

    Kill a pane, a window and a session

    4 min

    Close things at each level of the model with x, & and kill-session.

    C-bthenxC-bthen&:kill-session -t name
  4. 04

    Zoom a pane

    3 min

    Make one pane fill the window temporarily and see the Z flag in the status line.

    C-bthenz
  5. 05

    Resize panes

    3 min

    Grow and shrink panes in small and large steps with the Ctrl and Meta arrow keys, or from the prompt.

    C-bthenC-LeftC-bthenM-Left:resize-pane -R 20
  6. 06

    Apply window layouts

    4 min

    Cycle through the preset layouts with Space, pick layouts by name from the prompt, and confirm the Meta keys with the help prompt.

    C-bthenSpace:select-layout nameC-bthenM-1
  7. 07

    Mark and swap panes

    4 min

    Swap neighbouring panes with braces, then mark a pane and swap it with the active one from the prompt.

    C-bthen}C-bthenm:swap-pane
  8. 08

    Move and renumber windows

    4 min

    Move a window to a new index, swap two windows using the marked pane, and close the gaps.

    C-bthen.:swap-window:movew -r
  9. 09

    Browse in tree mode

    3 min

    Open the tree of sessions, windows and panes, switch to another session, then pick a specific window from the expanded tree.

    C-bthensC-bthenwEnter
  10. 10

    Tag and kill from the tree

    3 min

    Tag several windows and sessions in tree mode and kill them together.

    tX:
  11. 11

    Kick out a stale client

    4 min

    See two other clients attached to a session, detach one from client mode, then take the session over with attach -d.

    C-bthenD:attach -d -t name:detach-client -a
  12. 12

    Challenge: tidy a messy session

    challenge10 min

    Rename, rearrange, kill and detach until a cluttered session becomes a clean two-window project layout.