Skip to content

feat: smart pager for gw log - #43

Merged
jondeibel merged 2 commits into
mainfrom
feat/smart-pager
Mar 10, 2026
Merged

jondeibel merged 2 commits into
mainfrom
feat/smart-pager

Conversation

@jondeibel

Copy link
Copy Markdown
Owner

Summary

  • gw log now auto-detects when output exceeds the terminal and pipes through a pager
  • Pager opens focused on your current branch (~1/3 down the screen)
  • Tree output buffered to string, PR data rendered inline (removes fragile ANSI cursor hack)
  • Pager selection: $GW_PAGER > $PAGER > less -R
  • --no-pager flag for direct output
  • Non-TTY (piped/redirected) output is never paged

Test plan

  • All 146 tests pass (non-TTY, so pager never activates)
  • Manual: small tree prints directly
  • Manual: large tree opens in pager focused on current branch
  • Manual: --no-pager forces direct output
  • Manual: no over-scroll when current branch is near end of output

🤖 Generated with Claude Code

jondeibel and others added 2 commits March 10, 2026 11:18
When output exceeds terminal height, automatically pipe through a pager
(less -R by default). The pager opens focused on the current branch with
context above. Output that fits prints normally, and piped/redirected
output is never paged.

- Buffer tree output to string instead of println
- Include PR data inline (removes retroactive ANSI cursor hack)
- Pager selection: $GW_PAGER > $PAGER > less -R
- --no-pager flag to force direct output
- Focus line capped to prevent over-scrolling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jondeibel
jondeibel merged commit ac00ddd into main Mar 10, 2026
1 check passed
@jondeibel
jondeibel deleted the feat/smart-pager branch March 10, 2026 15:20
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.

1 participant