Skip to content

fix(mobile): preserve terminal scroll position across keyboard resize and replay #259

Description

@DodgyBadger

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions