Skip to content

feat: replay scrollback history to boo ui views on attach#72

Open
BenLocal wants to merge 1 commit into
coder:mainfrom
BenLocal:feat/ui-scrollback-replay
Open

feat: replay scrollback history to boo ui views on attach#72
BenLocal wants to merge 1 commit into
coder:mainfrom
BenLocal:feat/ui-scrollback-replay

Conversation

@BenLocal

Copy link
Copy Markdown

A boo ui view's scrollback lived only in its local terminal and was built from output streamed while attached. Switching sessions destroys the view (and its scrollback) and creates a fresh one, and the daemon's attach replay (repaint) deliberately sends only the visible screen, so a just-switched-to view had nothing above the current screen to scroll up into.

Replay the window's history to ui views on attach:

  • window.historyReplay: VT bytes that reproduce the scrollback HISTORY (rows above the visible screen) as a styled, scrolling stream, plus a full-screen flush so every history row lands in the canvas's scrollback before the repaint's erase, with no blank gap. Fed before repaint(), a fresh terminal ends up holding the same scrollback, viewport at bottom.
  • protocol.AttachPayload: the attach handshake now carries a ui flag (decodes a bare 4-byte size payload as non-ui for slack).
  • The daemon sends the history (chunked across output frames, since it can exceed max_payload) before the repaint, but only to ui clients. A plain boo attach is raw passthrough, where a history dump would spam the user's real terminal, so it stays history-free.

Verified end to end: a ui attach receives scrolled-off history; a plain attach receives only the visible screen.

A boo ui view's scrollback lived only in its local terminal and was
built from output streamed while attached. Switching sessions destroys
the view (and its scrollback) and creates a fresh one, and the daemon's
attach replay (repaint) deliberately sends only the visible screen, so a
just-switched-to view had nothing above the current screen to scroll up
into.

Replay the window's history to ui views on attach:

- window.historyReplay: VT bytes that reproduce the scrollback HISTORY
  (rows above the visible screen) as a styled, scrolling stream, plus a
  full-screen flush so every history row lands in the canvas's scrollback
  before the repaint's erase, with no blank gap. Fed before repaint(), a
  fresh terminal ends up holding the same scrollback, viewport at bottom.
- protocol.AttachPayload: the attach handshake now carries a `ui` flag
  (decodes a bare 4-byte size payload as non-ui for slack).
- The daemon sends the history (chunked across output frames, since it
  can exceed max_payload) before the repaint, but only to ui clients.
  A plain `boo attach` is raw passthrough, where a history dump would
  spam the user's real terminal, so it stays history-free.

Verified end to end: a ui attach receives scrolled-off history; a plain
attach receives only the visible screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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