Skip to main content

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

From status.c:227-238, the status line is updated based on intervals:

Basic Configuration

Enabling and Positioning

Update Interval

From status.c:178-200:

Styling the Status Line

Colors and Attributes

From status.c:406-417, the status line applies styles:
Available attributes:
  • bright or bold
  • dim
  • underscore
  • blink
  • reverse
  • hidden or invisible
  • italics
  • strikethrough

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

Supports strftime 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

From status.c:427-463, each window is formatted in the status line:

Window Status Formats

Window Flags

From window.c:877-904, windows display various flags:
  • * - Current window
  • - - Last window (previously selected)
  • # - Activity in window (when monitor-activity on)
  • ! - Bell in window
  • ~ - Silence in window (when monitor-silence on)
  • M - Marked pane in window
  • Z - Window is zoomed

Custom Status Format

From status.c:428, tmux supports status-format array for multiple status lines:

Messages and Prompts

From status.c:475-526 and status.c:554-606:

Message Display

Command Prompt

From status.c:622-680:

Advanced Styling

Style Ranges

From status.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.
  • colour0 through colour255 for 256-color palette
  • default for 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

  1. Keep it readable: Don’t overload with information
  2. Use colors wisely: Maintain good contrast
  3. Set appropriate intervals: Balance freshness vs. CPU usage
  4. Test on different terminals: Verify color support
  5. Consider width: Remember the status line width is limited
  6. Use format conditionals: Show information only when relevant
  7. Document your config: Comment complex format strings
This shows red when prefix is pressed, green otherwise.