Customize the status line
The status line is at the top, red, and shows only %H:%M on the right.
Three options draw the bar:
status-positiontoporbottomstatus-style- a style, such as
bg=red status-right- a format string;
%H:%Mis 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.
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.
Here is what just happened.
status-style bg=red replaced the default bg=green,fg=black; one term, so only the background changed. status-right '%H:%M' overwrote the whole format, dropping the title and date. Sourcing applied all three set -g lines to every session on the server.
- Put the status line at the top of the screen:set -g status-position top
- Style the whole status line (bg, fg, bold, underscore and so on):set -g status-style bg=red
- Replace the right side with a date format:set -g status-right '%H:%M'
Go further
set -g status offhides the bar entirely.status-left-styleandstatus-right-styleoverridestatus-stylefor their part of the bar.window-status-current-style underscoreunderlines the current window’s entry.
- 1
status-rightreplaces the whole right side; setting it to'%H:%M'drops the title and date, it does not add to them. - 2Three options:
status-position top,status-style bg=red,status-right '%H:%M', each withset -gin the file. - 3
open ~/.tmux.conf, add the three lines, Ctrl-S, thenC-b :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- status-position is top— not done yet
- status-style includes bg=red— not done yet
- status-right is exactly %H:%M— not done yet