Replay pane mouse-tracking modes in the attach snapshot #128

Closed
opened 2026-08-31 22:04:29 +01:00 by naps62-yolo · 0 comments
Collaborator

Touch scrolling does nothing in a browser that attaches to an already-running session on the alternate screen.

web/src/attach.ts picks its touch-scroll route from term.modes.mouseTrackingMode. Full-screen apps (tmux, Claude Code) enable mouse reporting once, with CSI ? 1002 h / CSI ? 1006 h, long before a new client connects. The attach snapshot built by render_screen_snapshot in crates/maestro-daemon/src/tmux.rs replays the alternate-screen switch, the content and the cursor, but not those mode sets.

A freshly opened browser therefore sees buffer.type === "alternate" with mouseTrackingMode === "none", falls into the branch that deliberately does nothing, and never scrolls. A browser that was already connected when the app started saw the original sequences and works.

Fix: read the pane's mouse flags in the same display-message call (mouse_standard_flag, mouse_button_flag, mouse_all_flag, mouse_sgr_flag, mouse_utf8_flag) and emit the matching DECSET sequences in the snapshot.

Touch scrolling does nothing in a browser that attaches to an already-running session on the alternate screen. `web/src/attach.ts` picks its touch-scroll route from `term.modes.mouseTrackingMode`. Full-screen apps (tmux, Claude Code) enable mouse reporting once, with `CSI ? 1002 h` / `CSI ? 1006 h`, long before a new client connects. The attach snapshot built by `render_screen_snapshot` in `crates/maestro-daemon/src/tmux.rs` replays the alternate-screen switch, the content and the cursor, but not those mode sets. A freshly opened browser therefore sees `buffer.type === "alternate"` with `mouseTrackingMode === "none"`, falls into the branch that deliberately does nothing, and never scrolls. A browser that was already connected when the app started saw the original sequences and works. Fix: read the pane's mouse flags in the same `display-message` call (`mouse_standard_flag`, `mouse_button_flag`, `mouse_all_flag`, `mouse_sgr_flag`, `mouse_utf8_flag`) and emit the matching DECSET sequences in the snapshot.
naps62 was assigned by naps62-yolo 2026-08-31 22:04:38 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: naps62/maestro#128