statusline JSON should include terminal dimensions (columns/rows)
the statusline command runs as a subprocess, so it has no access to the real terminal dimensions. tput cols, [Console]::WindowWidth, and mode con all return defaults (80 or 120) rather than the actual terminal size.
this makes it impossible to build responsive statuslines that shed optional segments when the terminal is narrow. the parent cc process has access to the real dimensions - passing them in the statusline JSON would solve this cleanly.
request
add terminal.columns and terminal.rows (or similar) to the JSON piped to the statusline command.
current workaround
none that work reliably. hardcoding a threshold is the only option, which breaks when users resize their terminal.
context
the statusline JSON already includes model, context window, rate limits, workspace, cost, session info, etc. terminal dimensions would be a small addition that enables responsive layouts.
4 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
+1 on this.
I ran into the same issue while building claude-pace. For multi-line statuslines, not having the real terminal
columns/rowsmakes responsive layouts much harder than they should be.Hardcoded width assumptions are fine until the terminal gets resized, then things wrap or disappear in the wrong places. Exposing terminal dimensions in the statusline JSON would make custom statuslines a lot more reliable.
closing as duplicate of #22115 which covers the same request (pass terminal dimensions to statusline subprocess) plus the related wrapping calculation issue. added context there instead
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.