Skip to content

feat: scroll primary-screen sessions with the mouse wheel in boo ui#28

Merged
kylecarbs merged 1 commit into
mainfrom
feat/ui-wheel-scrollback
Jun 11, 2026
Merged

feat: scroll primary-screen sessions with the mouse wheel in boo ui#28
kylecarbs merged 1 commit into
mainfrom
feat/ui-wheel-scrollback

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

Summary

Wheel events over the boo ui viewport were dropped unless the application had asked for mouse reporting. Since the client renders from terminal state and is never on an alternate TTY itself, the wheel can drive proper scrollback instead:

  • The view terminal now keeps 512KB of scrollback (was 0). Wheel-up over the viewport pages into history, 3 rows per tick; wheel-down pages back.
  • While scrolled: the viewport pins to its content (streaming output does not yank it), the session cursor is hidden, and the bottom row hints scrollback wheel down or esc to return.
  • A lone Esc snaps back to live output. Any typed input, paste, or forwarded arrow key snaps back first so it lands where the user can see it.
  • Selection/copy and rendering read viewport-relative pins, so dragging over scrolled-back content copies what is on screen.

The daemon's passthrough strips alternate-screen toggles, so clients cannot tell which screen an application is on. A new .screen protocol message (payload alt/primary, sent with every repaint, which accompanies attach, redraw, and screen switches) carries that state. Full-screen applications (vim, less, htop) get 3 arrow keys per wheel tick instead, matching terminals' alternate-scroll mode; SS3 variants when the app enabled cursor-keys mode. Apps that request mouse reporting keep receiving raw wheel events, unchanged.

boo attach is intentionally unchanged: capturing the wheel there would require enabling mouse reporting on the user's real terminal, breaking native text selection.

Validation

  • zig build test-all --summary all: 122/122 (2 new integration tests).
  • zig build test-all -Doptimize=ReleaseSafe: 122/122.
  • New: ui: wheel scrolls primary-screen scrollback (streams 40 lines through cat, wheels to the clamped top, asserts the first line and the hint render, lone Esc returns to the bottom) and ui: wheel sends arrows to alternate-screen applications (app on alt screen, one wheel tick arrives as ^[[A^[[A^[[A via cat -v).

Caveat

Scrollback accumulates from the moment the ui focuses a session; the attach repaint seeds the active screen only. Earlier history is still available via boo peek --scrollback. A history-seeded repaint behind a protocol flag is a possible follow-up.

This PR was generated with Coder Agents on behalf of @kylecarbs.

The ui dropped wheel events over the viewport unless the application
had asked for mouse reporting. Now the view terminal keeps 512KB of
scrollback and the wheel pages through it: scrolling pins the
viewport, hides the session cursor, and shows a bottom-row hint;
wheeling back down or a lone Esc returns to live output, and typed
input snaps back first so it lands where the user can see it.

The daemon's passthrough strips alternate-screen toggles, so clients
cannot tell which screen an application is on. A new .screen protocol
message, sent with every repaint (attach, redraw, screen switches),
carries that state; full-screen applications get three arrow keys per
wheel tick instead, matching terminals' alternate-scroll mode.
@kylecarbs kylecarbs merged commit 7d756dc into main Jun 11, 2026
4 checks passed
@kylecarbs kylecarbs mentioned this pull request Jun 11, 2026
kylecarbs added a commit that referenced this pull request Jun 11, 2026
Wheel scrollback in boo ui (#28).
@kylecarbs kylecarbs deleted the feat/ui-wheel-scrollback branch June 11, 2026 20:44
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