โ– humdrum codex / glint v1.1.2
license AGPL-3.0

โ† issues

TASK-034 Preview mode: release mouse capture so native terminal select+copy works

๐ŸŸข In progress bug priority: medium

created 2026-07-01 01:25 ยท updated 2026-07-01 01:58

Description

Preview mode (glamour read view) currently inherits the app-wide tea.WithMouseCellMotion() set in main.go, so the terminal hands all mouse events to glint instead of the terminal emulator, blocking native click-drag text selection and Cmd+C. Editor mode needs mouse capture for drag-select (TASK-027); preview mode is read-only and doesn't. Fix: in togglePreview() (internal/app/app.go), emit tea.DisableMouse() when entering ModePreview and tea.EnableMouseCellMotion() when leaving it, so preview restores normal terminal text selection while editor mode is unaffected.

Acceptance Criteria

Implementation Notes

togglePreview() now returns tea.DisableMouse on entry / tea.EnableMouseCellMotion on exit. main.go's run() also skips tea.WithMouseCellMotion() at startup when launching straight into preview (glint -p), via new App.InPreview(). Wheel-scroll still reaches the viewport via arrow-key emulation most terminals do for alt-screen apps when mouse reporting is off, and PgUp/PgDn/j/k already work via bubbles viewport's key handling regardless. AC#3 (manual Cmd+C verification) left unchecked โ€” needs a human to test in an actual terminal.

Correction: AC#4 unchecked too โ€” arrow-key wheel emulation when mouse-off is common (iTerm2/xterm/kitty in alt-screen) but not guaranteed on every terminal; needs the same manual check as AC#3, not asserted from code alone.