Problem
On mobile, scrolling through terminal history is inconsistent because keyboard viewport changes and terminal replay/reflow can move the viewport back to the bottom. A successful scroll can appear to fail, and earlier output can seem lost.
Likely paths:
- KeyboardHandler._scheduleViewportSettle() currently calls terminal.scrollToBottom() after keyboard show/hide.
- Buffer replay and full-history repulls reset/rewrite xterm and restore position independently.
- Touch scrolling in terminal-ui.js tracks manual scrolling, but that intent is not preserved across these paths.
Expected behavior
Treat the terminal as either following live output or viewing history. Preserve the visible anchor during keyboard resize/reflow and replay when the user has scrolled up; only jump to bottom when already following output.
Acceptance criteria
- Opening or closing the mobile keyboard does not move a terminal that is scrolled up.
- Users following live output remain pinned to the bottom.
- Tab replay and full-history repull preserve a sensible viewport position.
- Add targeted mobile regression coverage.
Problem
On mobile, scrolling through terminal history is inconsistent because keyboard viewport changes and terminal replay/reflow can move the viewport back to the bottom. A successful scroll can appear to fail, and earlier output can seem lost.
Likely paths:
Expected behavior
Treat the terminal as either following live output or viewing history. Preserve the visible anchor during keyboard resize/reflow and replay when the user has scrolled up; only jump to bottom when already following output.
Acceptance criteria