fix(statusline): reserve a fixed 5 columns instead of 20% of width#2871
Merged
Conversation
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>
worktrunk-bot
approved these changes
May 21, 2026
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Claude Code statusline runs
wt list statuslineas a subprocess with all three standard streams piped, soterminal_width()can't detect the terminal directly anddetect_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_subguards 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.