Skip to content

fix(mobile): buffer DEC 2026 synchronized redraws and coalesce animated keyboard fits - #742

Merged
chareice merged 1 commit into
mainfrom
fix/mobile-keyboard-sync-redraw
Nov 27, 2026
Merged

chareice merged 1 commit into
mainfrom
fix/mobile-keyboard-sync-redraw

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

Fixes mobile/foldable terminals visibly scrolling from way up in history down to the bottom every time the soft keyboard opens or closes:

  • DEC 2026 Synchronized Output buffering in useTerminalLiveSocket.ts (via shared syncOutputScanner.ts + unit tests): Holds chunks between \x1b[?2026h (BSU) and \x1b[?2026l (ESU) up to 512 KiB (with 150ms idle / 450ms max guard timer) and flushes the full redraw into xterm.js in a single atomic term.write() call instead of streaming partial frames across multiple rAFs.
  • Zero mid-animation keyboard resizes in mobileViewportFitScheduler.ts: Defers the first frame of a resize by 1 extra rAF when settleDebounceMs > 0 so animated Android/iOS keyboard slides enter the settle debounce instead of firing a mid-slide resize on frame 1 (while single discrete resizes still land within 2 frames).
  • Preserve bottom pin on local resize (useTerminalFitController.ts): Calls term.scrollToBottom() after term.resize() when already pinned to the bottom so xterm's viewport never drifts upward on height shrink/expand.

@chareice
chareice merged commit f052e92 into main Nov 27, 2026
12 checks passed
@chareice
chareice deleted the fix/mobile-keyboard-sync-redraw branch November 27, 2026 14:53
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