Skip to content

Statusline

The ox TUI renders a single-row statusline at the bottom of the screen in one of two modes: built-in configurable segments (the default) or full external command replacement.

By default, the statusline renders rounded pill badges split into left and right groups:

  • Left: Active model display name (falling back to the wire model ID) and context usage formatted as <pct>% (or Ctx: <pct>% in plain and powerline styles) when the context window size is known, or <used>k otherwise. Context usage changes color across three configurable thresholds (context_thresholds.warn_pct and context_thresholds.error_pct, defaulting to 50 and 80).
  • Right: expanded when tool details are expanded (Ctrl+O), plus the active agent state (thinking, streaming, or the running tool name) only while busy.

StatusLineConfig is deserialized from TOML by ox-tui and exposes style, left, and right fields so callers can choose a layout style and reorder or customize the bar.

Comparison of pill, plain, and powerline statusline styles

Style Description
pill Default. Rounded pill badges with theme-derived backgrounds and 1-cell Unicode icons (falling back to [ / ] in ASCII)
plain Minimal flush-left segments with an accent model label, configured status_separator, and Ctx: <pct>% labels
powerline Alternating pill backgrounds joined by chevron transitions (falling back to > / < in ASCII)
Segment Description
model Active model display name (or wire model identifier)
context Context token usage with 3-tier color thresholds
expanded Shown as expanded when tool call details are expanded
status Active agent state (thinking, streaming, or tool name)
{ command = ["..."] } First stdout line from an external command as one segment
[statusline]
style = "pill"
left = ["model", "context", { command = ["git", "branch", "--show-current"] }]
right = ["expanded", "status"]
[statusline.context_thresholds]
warn_pct = 50
error_pct = 80

Setting command on StatusLineConfig replaces the built-in layout with the first line of stdout from an external command:

[statusline]
command = ["my-statusline", "--compact"]

ox writes a JSON snapshot to the command’s stdin:

{
"cwd": "/path/to/repo",
"workspace": { "current_dir": "/path/to/repo" },
"model": { "id": "gemini-4-hydrogen" },
"context": { "used_tokens": 12000, "window_size": 1048576 },
"status": "idle"
}

The stdout line is parsed with a built-in ANSI SGR parser supporting 16-color, 256-color, and 24-bit RGB foreground and background colors along with bold, dim, italic, underline, and reset modifiers.