learntmux.dev

Use the mouse

Goal

Mouse on, right pane active, window logs current, and a drag has copied text.

set -g mouse on at the prompt turns mouse support on. Nothing visibly changes — but four things start working:

click a pane
make it active
click a window name in the status line
switch to it
drag over text and release
copy it into a buffer
drag a border
resize

mouse is an option: a named setting held on the server, a session or a window, changed with set-option (set for short). -g sets it globally, for every session.

Do this

Press C-b :, type set -g mouse on, Enter.

Nothing on screen changes.

Click the right pane, the one showing right pane.

Its border highlights — it is now active.

Click logs in the status line.

Window logs is current.

Drag across a word in the pane and release.

The text is now in a buffer.

How mouse bindings work

With the mouse on, mouse events are key bindings like any other: a click runs select-pane or select-window, a border drag runs resize-pane. A right click opens a menu with each command’s key shown beside it.

Stuck on this one?

This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.

A real terminal, in this tab

about 15 MB, once

session learn

Done when

not started
  1. The mouse option is on— not done yet
  2. The right pane of window 0 (index 1) is active— not done yet
  3. Window logs (index 2) is the current window of session learn— not done yet
  4. A drag copied text into an automatically named buffer— not done yet