learntmux.dev

Configure the pane border

Goal

Borders red, the active border on yellow, and a bold title above every pane.

Four window options own the borders:

pane-border-style
every border
pane-active-border-style
the active pane’s, layered on top
pane-border-status
top or bottom to add a line to each border
pane-border-format
what that line shows

The last one takes the same #{...} formats and #[...] styles you used on the status line, so everything from the previous two tasks applies here unchanged. All four are window options, set with set -g.

Do this

Run open ~/.tmux.conf, add these lines, and save with Ctrl-S:

set -g pane-border-style fg=red
set -g pane-active-border-style 'fg=red,bg=yellow'
set -g pane-border-status top
set -g pane-border-format '#[bold]#{pane_title}#[default]'

Press C-b :, type source ~/.tmux.conf, Enter.

A bold title appears above each pane and the borders turn red.

Press C-b Right, then C-b Left.

The yellow background follows the active pane.

The cost of pane title bars

The title bar costs one row per pane, which is worth remembering in a window split four ways.

#{pane_title} is what pane-border-format shows by default, and the title itself defaults to the host name until you set one.

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. pane-border-style has a foreground colour set— not done yet
  2. pane-active-border-style has a yellow background— not done yet
  3. pane-border-status is set to top— not done yet
  4. pane-border-format bolds the pane title— not done yet