Skip to content

Support multi-line output from status_line.command (configurable max_lines) #4162

Description

@taosmos

Motivation

status_line.command currently renders only the first stdout line (status-line-command.ts truncates at the first \n). Claude Code's statusLine contract works the same way, so the seam is familiar — but terminal real estate below line 1 sits unused, and richer status dashboards (quota windows, task boards, per-provider usage bars) genuinely need a few rows.

Concrete use case: a community statusline that shows plan/quota usage bars, a clock, and a per-file startup-context breakdown — laid out over several rows above the context readout. Today this requires patching the CLI binary.

Proposal

Add an optional [status_line] max_lines setting in tui.toml (integer, 1–16, default 1):

  • Default 1 = exactly today's behavior (first line only). Zero change for existing users.
  • When raised, extra stdout lines render between line 1 and the built-in context row, each truncated to the footer width.
  • The stdin JSON snapshot gains an optional termWidth field (footer render width in columns) so multi-line commands can lay out responsively.

Bounds and safeguards stay as today: 300ms timeout, 1s throttle, 64KB capture cap, any failure falls back to the built-in layout.

Reference implementation

I have a complete patch against the 2.1.1 tag (also applies cleanly to main as of 2026-10-10): 5 files — footer.ts, status-line-command.ts, the footer status-line tests (22 passing, incl. default-keeps-first-line and maxLines-cap cases), and the en/zh config-files.md rows. Happy to open a PR if a maintainer invites external code for this.

Alternative shape if you prefer: a fixed cap (e.g. 16 lines) without a config knob — the patch already implements that variant; making it a config keeps the default byte-for-byte compatible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions