Configure the pane border
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-statustoporbottomto add a line to each borderpane-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.
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.
Here is what just happened.
Every border took fg=red; the active pane’s added bg=yellow on top. pane-border-status turned the title line on and pane-border-format filled it: #[bold] on, the title, #[default] off again so nothing after stays bold.
- Style of inactive pane borders:set -g pane-border-style fg=red
- Style of the active pane border:set -g pane-active-border-style 'fg=red,bg=yellow'
- Show a status line in each pane border using pane-border-format:set -g pane-border-status top
Go further
select-pane -T namesets a pane’s title by hand.pane-border-lineschanges the characters the border is drawn with.- All the style attributes and colours from the status line work here too.
- 1Border styles use the same
fg=andbg=terms asstatus-style, comma-separated for both:'fg=red,bg=yellow'. - 2
pane-border-status topturns the title bar on;pane-border-formatis what it shows, with#[bold]and#{pane_title}. - 3Four lines in
~/.tmux.conf:pane-border-style fg=red,pane-active-border-style 'fg=red,bg=yellow',pane-border-status top,pane-border-format '#[bold]#{pane_title}#[default]'. Then:source ~/.tmux.conf.
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
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- pane-border-style has a foreground colour set— not done yet
- pane-active-border-style has a yellow background— not done yet
- pane-border-status is set to top— not done yet
- pane-border-format bolds the pane title— not done yet