statusline JSON should include terminal dimensions (columns/rows)

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Mar 31, 2026 · closed Apr 1, 2026

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.

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/22115

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Astro-Han · 6 months ago

+1 on this.

I ran into the same issue while building claude-pace. For multi-line statuslines, not having the real terminal columns / rows makes 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.

seanmartinsmith · 6 months ago

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

github-actions[bot] · 6 months ago

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.