Overview
The status line in tmux appears at the bottom (or top) of the screen and displays information about the current session. From the man page (tmux.1:51-53):A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands.
Status Line Architecture
Fromstatus.c:227-238, the status line is updated based on intervals:
Basic Configuration
Enabling and Positioning
Update Interval
Fromstatus.c:178-200:
Styling the Status Line
Colors and Attributes
Fromstatus.c:406-417, the status line applies styles:
brightorbolddimunderscoreblinkreversehiddenorinvisibleitalicsstrikethrough
Left and Right Sections
Format Strings
The status line supports format strings for dynamic content. From the man page, common format variables:Session Variables
#{session_name}- Name of session#{session_id}- Session ID (with $)#{session_windows}- Number of windows in session#{session_attached}- Number of clients attached#{session_created}- Session creation time#{session_activity}- Time of session last activity
Window Variables
#{window_index}- Window index#{window_name}- Window name#{window_id}- Window ID (with @)#{window_active}- 1 if window is active#{window_flags}- Window flags (#,!,~,*,-,Z)#{window_panes}- Number of panes in window
Pane Variables
#{pane_index}- Pane index#{pane_id}- Pane ID (with %)#{pane_current_command}- Command running in pane#{pane_current_path}- Current path in pane#{pane_width}- Pane width#{pane_height}- Pane height
System Variables
#{host}- Hostname#{host_short}- Hostname without domain#{pid}- Server PID
Time Variables
Supportsstrftime format:
%H- Hour (24-hour)%M- Minute%S- Second%d- Day of month%m- Month number%b- Month name (abbreviated)%Y- Year (4 digits)%a- Weekday name (abbreviated)
Example Configurations
Window Status
Fromstatus.c:427-463, each window is formatted in the status line:
Window Status Formats
Window Flags
Fromwindow.c:877-904, windows display various flags:
*- Current window-- Last window (previously selected)#- Activity in window (whenmonitor-activityon)!- Bell in window~- Silence in window (whenmonitor-silenceon)M- Marked pane in windowZ- Window is zoomed
Custom Status Format
Fromstatus.c:428, tmux supports status-format array for multiple status lines:
Messages and Prompts
Fromstatus.c:475-526 and status.c:554-606:
Message Display
Command Prompt
Fromstatus.c:622-680:
Advanced Styling
Style Ranges
Fromstatus.c:282-296, the status line supports style ranges for clickable regions:
Colors
Supported color formats:- Named colors:
black,red,green,yellow,blue,magenta,cyan,white - Bright variants:
brightred,brightgreen, etc. colour0throughcolour255for 256-color palettedefaultfor terminal default- Hex colors:
#ffffff,#ff0000, etc.
Example Configurations
Minimal Status Line
Detailed Status Line
Powerline-Style Status Line
Powerline symbols require a font with powerline support. Use Unicode characters:
(U+E0B0) and (U+E0B2).Best Practices
- Keep it readable: Don’t overload with information
- Use colors wisely: Maintain good contrast
- Set appropriate intervals: Balance freshness vs. CPU usage
- Test on different terminals: Verify color support
- Consider width: Remember the status line width is limited
- Use format conditionals: Show information only when relevant
- Document your config: Comment complex format strings