statusLine: only first line renders when command outputs multiple lines
Bug description
When statusLine.command is configured to a script that prints multiple lines to stdout, only the first line renders in the terminal UI. Subsequent lines are silently dropped — not truncated/wrapped, just absent.
This contradicts the documented behavior: "each echo or print statement displays as a separate row."
Environment
- Claude Code version: 2.1.128
- OS: macOS 26.6.2 (BuildVersion 25G83)
- Terminal: Apple Terminal (
TERM=xterm-256color) - Backend: custom
ANTHROPIC_BASE_URLpointing at an internal enterprise API proxy (not api.anthropic.com directly) statusLineconfig insettings.json:
``json``
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 2,
"refreshInterval": 60
}
Steps to reproduce
- Configure a
statusLinecommand script that emits 2+ lines via separateprintf/echostatements (e.g. line 1: model/dir info, line 2: a context-usage bar). - Start or resume a session.
- Observe the terminal: only line 1 of the statusLine output appears below the prompt. Line 2+ never renders — not on first render, not after subsequent turns, and it's reproducible in a brand-new terminal window/session too (ruling out "hasn't refreshed yet" as an explanation).
Confirmation that the script itself is not at fault
I instrumented the script to capture its own full rendered output into a variable, print it, and also log a copy to a debug file on every real invocation during a live session. The debug log shows the script correctly emitting all 4 of its lines (env/model line, context-usage bar line, budget bar line, budget warning line) with correct live data on every invocation — while the terminal UI simultaneously displayed only line 1. This confirms the multi-line output reaches stdout correctly; the client is not rendering everything past the first line.
Expected behavior
All lines printed by the statusLine command should render, one per row, as documented.
Actual behavior
Only the first line renders; all subsequent lines are silently dropped from display.