Add auto-wrap to statusline for narrow terminals - #9
Conversation
|
@claude review this pr |
|
Claude finished @Jn-Huang's task in 1m 5s —— View job PR Review
Overall this is a clean, well-structured implementation. The approach of pre-building both line parts and measuring visible length is sound. A few things worth noting: Correctness
Edge case: non-numeric cols=${COLUMNS:-$(tput cols 2>/dev/null || echo 120)}If Style
Minor nit
Verdict: Looks good to merge. The fallback chain ( |
Detect real terminal width by walking the parent process tree to find the TTY, then reserve 30% for Claude Code's right-side UI elements. Layout adapts progressively to fit: 1. Wide: everything on a single line 2. Medium: 2 lines — full path + full branch / model + context 3. Narrow: 2 lines — basename path + full branch 4. Very narrow: 2 lines — basename + truncated branch (12 chars) Also: - Trim deep paths to 2 trailing components (~/.../parent/dir) - Strip parenthetical suffixes from model name (e.g. "(1M context)") Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dd6aed3 to
5939c12
Compare
Summary
~/.../parent/dir)$HOMEsubstitution in piped subprocess contextTest plan
~/.../parent/dir)🤖 Generated with Claude Code