MoonshotAI / MoonshotAI/kimi-code

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

Open
#2,448 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with runStatusLineCommand in apps/kimi-code/src/tui/utils/status-line-command.ts and FooterComponent.render() in apps/kimi-code/src/tui/components/chrome/footer.ts. Trace the current stdout byte cap, newline handling, and truncateToWidth usage before deciding how multiline output interacts with the built-in context line. Done means preserving single-line behavior while rendering capped command output lines in order without exceeding the footer width.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.