Skip to content

fix(statusline): reserve a fixed 5 columns instead of 20% of width#2871

Merged
max-sixty merged 3 commits into
mainfrom
statusline-length
May 21, 2026
Merged

fix(statusline): reserve a fixed 5 columns instead of 20% of width#2871
max-sixty merged 3 commits into
mainfrom
statusline-length

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The Claude Code statusline runs wt list statusline as a subprocess with all three standard streams piped, so terminal_width() can't detect the terminal directly and detect_parent_tty_width() walks the process tree to find a TTY. That fallback reserved 20% of the detected width for Claude Code's own UI messages, which scales badly: on a 200-column terminal it gave up 40 columns, far more than the chrome needs. This reserves a fixed 5 columns instead, so wide terminals keep nearly all their width and narrow ones still get a sensible margin (saturating_sub guards against terminals under 5 columns).

Also adds a weekly tend maintenance task that scans the agent CLIs Worktrunk integrates with (Claude Code, Codex, Gemini CLI, OpenCode) for changes to the surfaces Worktrunk depends on — the statusline JSON schema, worktree-lifecycle hooks, and plugin install mechanisms — and files an issue when something relevant changes.

max-sixty and others added 2 commits May 21, 2026 13:28
The Claude Code statusline runs as a piped subprocess, so width comes
from the parent-TTY walk in detect_parent_tty_width(). Reserving 20% of
that width for Claude Code's UI messages scales badly: a 200-column
terminal gave up 40 columns. Reserve a fixed 5 columns instead, so wide
terminals keep nearly all their width; saturating_sub guards terminals
under 5 columns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Worktrunk's plugins depend on agent CLI surfaces (statusline JSON,
worktree-lifecycle hooks, plugin install mechanisms) that change without
notice. Add a weekly tend task to scan the Claude Code / Codex / Gemini
/ OpenCode changelogs and file an issue when a relevant change lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
codecov/patch flagged cols.saturating_sub(5) in detect_parent_tty_width()
as uncovered: it sits behind the parent-TTY walk, which never finds a TTY
in headless CI. Extract the stty-size parsing into a pure
statusline_width_from_stty_size() and unit-test it, the same testability
split statusline_width_fallback() already uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@max-sixty max-sixty merged commit 39cfd80 into main May 21, 2026
33 of 34 checks passed
@max-sixty max-sixty deleted the statusline-length branch May 21, 2026 21:05
max-sixty added a commit that referenced this pull request May 23, 2026
…2871)

The Claude Code statusline runs `wt list statusline` as a subprocess
with all three standard streams piped, so `terminal_width()` can't
detect the terminal directly and `detect_parent_tty_width()` walks the
process tree to find a TTY. That fallback reserved 20% of the detected
width for Claude Code's own UI messages, which scales badly: on a
200-column terminal it gave up 40 columns, far more than the chrome
needs. This reserves a fixed 5 columns instead, so wide terminals keep
nearly all their width and narrow ones still get a sensible margin
(`saturating_sub` guards against terminals under 5 columns).

Also adds a weekly tend maintenance task that scans the agent CLIs
Worktrunk integrates with (Claude Code, Codex, Gemini CLI, OpenCode) for
changes to the surfaces Worktrunk depends on — the statusline JSON
schema, worktree-lifecycle hooks, and plugin install mechanisms — and
files an issue when something relevant changes.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants