learntmux.dev

Customize the status line

Goal

The status line is at the top, red, and shows only %H:%M on the right.

Three options draw the bar:

status-position
top or bottom
status-style
a style, such as bg=red
status-right
a format string; %H:%M is the time

status-right replaces the whole right side; it does not add to it. The default is "#{=21:pane_title}" %H:%M %d-%b-%y — pane title, time, date — so setting it to just the time drops the other two. The % codes are the ones date uses.

Do this

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

set -g status-position top
set -g status-style bg=red
set -g status-right '%H:%M'

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

The bar jumps to the top, turns red, and its right end is just the time.

Writing styles

A style is terms separated by spaces or commas. fg= and bg= take a colour; bold, bright, underscore, reverse and italics stand alone.

Colours are the eight names, brightNAME, colour0 to colour255, or hex like #882244.

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. status-position is top— not done yet
  2. status-style includes bg=red— not done yet
  3. status-right is exactly %H:%M— not done yet