Skip to content

feat(tui): support multi-line output from status_line.command (align with Claude Code statusLine contract) #2448

Description

@chunxiaoxx

Summary

status_line.command currently renders only the first stdout line of the user command. Claude Code's statusLine contract (which the seam deliberately mirrors) renders all stdout lines, enabling multi-line HUD-style status bars such as claude-hud. Supporting multi-line output would let users build much richer status displays without forking.

Current behavior

runStatusLineCommand in apps/kimi-code/src/tui/utils/status-line-command.ts truncates stdout at the first \n and discards the rest:

child.stdout?.on('data', (chunk: string) => {
  if (stdout.includes('\n')) return; // first line is complete
  ...
});

and FooterComponent.render() in apps/kimi-code/src/tui/components/chrome/footer.ts hardcodes line 2 to the transient hint + context readout.

Desired behavior

When the configured command emits multiple lines, the footer renders them in order (e.g. up to a small cap like 5 lines), followed by — or replacing — the built-in context line, at the user's option. Single-line commands behave exactly as today, so this is fully backward compatible.

Use case

A HUD-style footer that shows, without crowding one line:

  • Line 1: model, cwd:branch, permission/plan mode
  • Line 2: context bar + quota/rate-limit windows (fetched from /coding/v1/usages)
  • Line 3: session duration, background task counts, external daemon status

Today all of this must be crammed into a single truncated line or dropped.

Suggested implementation (happy to PR)

  1. status-line-command.ts: keep the full stdout (still byte-capped) instead of slicing at the first newline.
  2. footer.ts render(): when the custom output contains \n, render each line via truncateToWidth, and keep appending the built-in context line unless the custom output already covers it (or gate this behind a config flag such as [status_line].multiline = true).

Thanks for considering!

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