# Restore Mobile Terminal Scrolling ## Summary The recent terminal scrollback optimization disabled scrollback for every viewport. Mobile terminal swipe handling still scrolls xterm's normal buffer programmatically, so swipes in normal-buffer tools no longer have retained output to move through. ## Root Cause `468f342` changed the terminal configuration to `scrollback: 0` globally to prevent stale repaint frames and wheel scrolling on desktop. The mobile touch handler calls `term.scrollLines()` when the normal buffer is active. With zero scrollback, that call has no scrollable history and becomes a no-op. ## Scope - `apps/web/src/components/features/terminal/terminal.tsx` - Focused terminal configuration test ## Fix Retain a bounded xterm scrollback buffer on mobile only (`10000` lines), while leaving desktop at zero scrollback and with wheel sensitivity disabled. Mobile's existing custom touch handler remains responsible for moving through normal-buffer history; alternate-screen swipes continue to send SGR wheel events to the active TUI. ## Acceptance Criteria - [ ] A mobile terminal with normal-buffer output exceeding one screen scrolls via a vertical swipe. - [ ] Alternate-screen terminal scrolling continues to use the existing SGR wheel-event path. - [ ] Desktop keeps zero xterm scrollback and disabled native wheel scrolling, so stale repaint frames do not return. - [ ] Focused unit test and frontend quality gates pass. ## Related - `468f342 fix(terminal): hide scrollbar and stop stale-frame wheel scroll for TUI tools` - `openspec/changes/fix-terminal-container-overflow`