learntmux.dev
LEVEL 3 · ADVANCED

Copy mode, paste buffers, search, the mouse, break and join panes.

Get text out of tmux and move panes between windows: copy mode, paste buffers, scrollback search, mouse support, break-pane and join-pane.

8 tasks · about 36 minutes · 20 key bindings

Start with task 1
  1. 01

    Copy text in copy mode

    4 min

    Enter copy mode, move the cursor with emacs-style keys, select a line and copy it into a paste buffer.

    C-bthen[C-SpaceM-w
  2. 02

    Scroll, search the scrollback and paste

    4 min

    Scroll back through long output, search for a request id, copy it and paste it into another pane.

    C-UpC-rC-bthen]
  3. 03

    Choose and delete buffers in buffer mode

    3 min

    Open the buffer list, paste an older buffer instead of the newest one, and delete a stale buffer.

    C-bthen=d
  4. 04

    Name, save and load buffers

    3 min

    Rename an automatic buffer, save it to a file and load a file into a named buffer from the command prompt.

    :setb -b old -n new:saveb -b name path:loadb -b name path
  5. 05

    Find a window by its content or name

    4 min

    Search all panes for a piece of text and jump straight to the window that shows it, then find a window by name from tree mode.

    C-bthenfC-sn
  6. 06

    Use the mouse

    4 min

    Turn on mouse support and use clicks to change the active pane and the current window, and a drag to copy.

    :set -g mouse on:bind MouseDown1Pane:bind MouseDown1Status
  7. 07

    Break out, join and send keys

    4 min

    Move a pane into its own window, pull a window back in as a pane, and type into a pane from the command prompt.

    C-bthen!:join-pane -s src:send-keys -t target keys
  8. 08

    Challenge: recover the secret from the logs

    challenge10 min

    Find the crashed worker, copy its token from deep scrollback, save it as a named buffer and a file, then paste it into your shell.