feat(statusline): add --compact mode#1093
Open
derekrprice wants to merge 1 commit intodanielmiessler:mainfrom
Open
feat(statusline): add --compact mode#1093derekrprice wants to merge 1 commit intodanielmiessler:mainfrom
derekrprice wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Adds an opt-in compact display that collapses the three banner sections
(header, USE/usage, PWD) into a single dense line, for users with short
terminal heights or who prefer minimal status output.
Changes:
- Parse --compact flag from script arguments
- Pre-compute reset times and context scaling once so the dense line and
the full USE section share the same values (avoids drift / double work)
- Emit a dense single line when --compact is set:
CTX:XX% | 5H:XX%↻HH:MM | 7D:XX%↻HH:MM | S:$X.XX
…in place of header, USE, and PWD sections
- Pipe all output through a new ANSI-aware truncate_output filter that
caps each line at 72 visible chars (matching the separator width).
Needed because Claude Code's statusline subprocess receives a stale
TTY width, so runtime width detection is unreliable
Enable by configuring in settings.json:
"statusLine": {
"type": "command",
"command": "~/.claude/statusline-command.sh --compact"
}
No behavior change without the flag.
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.
Summary
Adds an opt-in
--compactflag toReleases/v4.0.3/.claude/statusline-command.shthat collapses the three banner sections (header, USE, PWD) into a single dense line — useful for short terminal heights or users who prefer minimal status output.What it does
--compactflag from script arguments (default: off; no behavior change without the flag).--compactis set, emit a single dense line in place of the header + USE + PWD sections:truncate_outputfilter that caps each line at 72 visible chars (matching the separator width). This is needed because Claude Code's statusline subprocess receives a stale TTY width, so runtime width detection is unreliable; fixing the truncation width sidesteps that.Enabling it
🙋 About the destination
I targeted
Releases/v4.0.3/.claude/statusline-command.shbecause that's the file that's actually being shipped to users in v4.0.3 (matches byte-for-byte what my local installation runs). The top-level.claude/statusline-command.shat repo root is 833 lines and appears to be pre-v4.0.0 content that survived commite3ee9ad "Revert PAI v4.0.0 — Lean and Mean"and hasn't been touched since — so patching it would have diverged from the actual shipped statusline.I guessed on the target file. If you'd prefer this land somewhere else — top-level
.claude/, a newReleases/v4.0.4/, a separate patch series, etc. — happy to rework. Just let me know.Test plan
--compact: expect single dense summary line instead of the three banner sections.--compact: expect identical output to current v4.0.3 statusline (no-op path).