- Content-anchored replay travel reveals the notice on an upward move that reaches row 0 and retires it on a downward move back at live output, as a live scroll does.
- _captureViewportAnchor returns only viewportY, rowsFromBottom and context; tests read anchor.context.
- _onSessionNeedsRefresh clears the Reload mark only after a completed mux replay.
- A later drop during an open load keeps the deferred recovery's higher attempt.
- Replay travel that reaches row 0 reveals the partial-history notice; at live output it retires it.
- The onScroll coalescing test drives the scheduler instead of evaluating a source line.
- _restoreViewportAnchor searches expected - 4000 + rows .. expected + rows
(same 4,001 candidates / 4,064 reads): filled rows only move the reader
up, so gaps up to 4000 - rows land exactly, also at the scrollback cap.
- _resetAllAppState and _cleanupPreviousSession clear
_pendingDroppedOutputRecovery next to the recovery timer, so a reconnect
load does not resume a stale recovery and run a second full capture.
- Tests: capped 2,500- and 3,900-row gaps; both real cleanup methods drop
the pending recovery. Docs: the window and the beyond-window fallback.
- The notice's Load full history button pulls with anchor 'content' when
Reload history is eligible (read at click time, since the bar only
re-renders on eligibility transitions) and keeps 'top' otherwise.
- Tests: the single load control asserts the content anchor; an
ineligible session keeps the top anchor.
- _onSessionNeedsRefresh adds the session to _historyReloadDismissed when
the full capture would shrink the buffer and it falls back to ?tail=,
past the ownership guard, so a no-history pane is not re-captured by
the next tap.
- Changeset: scope the note to agent sessions (seen with OMP).
- CLAUDE.md: one warning sentence on the Reload history rules.
- terminal-resilience test reads each whole method instead of a
4,000-character window.
- _onSessionNeedsRefresh samples the live-output generation before its
fetch and, after replaying a mux-full-history capture, clears
_liveOutputSinceFullPull and _historyReloadDismissed while it still owns
the active session and the generation is unchanged; the ?tail= fallback
never clears them.
- test/terminal-viewport-marker.test.ts: gated test driving the real
flushPendingWrites over @xterm/headless at a full scrollback; the reading
row holds with the marker and drifts without it.
- Docs: the anchor sentence matches minimumScore, and the refresh rule is
in the Repair while reading paragraph.
- A content-anchored reload answered by anything but mux-full-history (an
empty response, or the byte-history fallback for a blank or failed pane
capture) adds the session to _historyReloadDismissed until the next mux
replay; only a mux replay clears the mark, so each tap repeated a forced,
unbounded capture. An error envelope leaves it available.
- Only the request still current (active session and select generation)
may dismiss: a slow answer from before an A -> B -> A switch must not
retire the action a newer capture already cleared.
- _historyReloadActionEligible() also requires no terminal load state:
selectSession sets it before switching activeSessionId, so the sync
right after the switch no longer offers Reload for the loading tab.
- _clearTerminalLoadState() re-syncs the action, so a marked tab offers
Reload once its load ends.
- Changeset: note the reading-position fix for live flushes at the
scrollback cap.
- _historyReloadActionEligible() no longer reads _paneHistoryLines: it is
recorded at the last load, so a session first opened empty kept 0 after
the burst that opens the gap, and the action never appeared (found by the
live #814 recipe).
- A pane with no tmux history is still retired by the downgrade refusal,
which dismisses the action until the next mux-full-history replay.
- Reload history requires pane history and no buffer load in flight; a
downgrade-refused pull hides it until the next mux-full-history replay,
and a stale tap re-checks eligibility before fetching.
- x during Loading... hides the bar at once; the pull continues.
- The content anchor scores up to 64 visible rows, so repeated TUI borders
cannot outvote the row being read; ambiguous matches keep the viewport.
- Live flushes track the reading row with an xterm marker across
scrollback trimming at the cap.
- Docs: Settings-Reference row, Dashboard notice text, ~1 s capture cost,
byte-history replays rely on the top-of-buffer pull.
- Scrolling pulls tmux history only at the top of the buffer again (#205);
the automatic pull on any upward scroll is removed.
- Reload history lives in the existing #historyTruncationBar on desktop and
touch, shown for a marked non-shell session scrolled away from live output.
It never duplicates Load full history; one × dismisses what the bar carried.
- New per-device setting historyReloadAction (Terminal & Input > Scrolling &
rendering), default on, kept out of SettingsUpdateSchema.
- Eligibility sync is transition-only and onScroll is coalesced per frame.
- Remove the floating #historyReloadBtn and its z-index 20 layer.
- Deferred dropped-output recovery resumes at its saved attempt.
- zh-CN entries for the new strings; docs and changeset updated.
Review follow-up on #815, and the phone case from #814: the gap opens
below a reader who stays scrolled up while output arrives, and the
bottom-only trigger never fired there.
- Open the buffer load before the capture fetch so output arriving during
the download is queued and replayed, not wiped by the reset. Every
non-replay exit flushes the queue. A drop at the 128 KiB cap during an
open load is deferred and resumed when the load ends instead of
spending its retries against it.
- Clear the live-output mark only when the response is
source 'mux-full-history', on the scroll and tab-switch paths.
- Repair on any upward scroll in a marked non-shell session, not only
from the bottom. A content anchor (3-row signature, searched at most
2000 rows either side) keeps the row being read in place; no match
falls back to distance from the bottom.
- Tie replay travel to its session so a tab switch does not swallow
moves on the new tab.
- Reveal the partial-history notice when the initiating gesture
reached the top, even if the anchor moved the viewport off row 0.
- Touch-only Reload history button (#historyReloadBtn), styled in
styles.css so wide touch viewports get it too. Non-touch pages skip
its work entirely.
- Docs, JSDoc and a changeset. Unit tests, and a Playwright browser test
with trusted touch events and real xterm.
Fixes#814
Review follow-up. The early re-pull sampled the live-output generation after
its fetch, but nothing gates live output while the capture downloads, so
output newer than the capture was overwritten and the session marked clean.
Sample before the fetch.
Travel made during the replay was one signed sum clamped once, so scrolling
to the bottom and back up cancelled out. Record moves in order and clamp
after each, as live scrolling does.
A tmux repaint burst overwrites rows that never reach xterm scrollback,
leaving a hole just above the live screen. The #205 re-pull only fired at
viewportY 0, so the user had to scroll past the hole first.
Mark a non-shell session dirty on each live write; the first upward scroll
from the bottom of a dirty session runs the existing full-history re-pull
anchored to the bottom, keeping the viewport's distance from live output and
replaying travel made during the replay. Cooldown, downgrade guard and the
top-of-buffer path are unchanged.
After a server restart the byte recording a tab switch replays (`?tail=`) holds only the tmux client's attach repaint, so an inline Claude session came back with an empty local buffer while tmux still held its scrollback. The hollow-buffer fallback then sent PageUp/PageDown to Claude, which moved the composer cursor instead of the transcript, until a page reload. Pre-existing on an unmodified build; every restart of the server showed it.
The paging fallback now stands down when the last capture reported tmux scrollback (`paneHistoryLines` > 0), dropping the gesture debt and any page keys already queued, so the gesture falls through to the local path, whose scroll-to-top pull fetches `full=1` and the gesture scrolls on from there. Zero and unknown counts keep paging (fullscreen Claude, codex, opencode, remote and Docker panes). The pull no longer inherits a downgrade refusal's 60 s latch for such a buffer, drops a completion that outlived a tab switch back to the same session (select generation, not only the session id), records no count from an error envelope (a JSON 5xx would otherwise forget it and hand the next gesture back to paging), and re-positions the local-echo overlay after its rewrite. The refresh path records its count only once it still owns the terminal, for the same reason. The `[scroll]` line prints `paneHistoryLines` so an unloaded buffer reads apart from a hollow one, and the invariant docs record the exception.
Measured with phone emulation after a restart: before, the second visit landed at baseY 0 and every swipe sent PageUp; after, the first swipe fetched the history once with nothing sent to Claude and the gesture scrolled 21 rows, with an unsent draft intact on the overlay.
- Skip and latch a bounded Shell window once the browser is at xterm's
scrollback cap (scrollback + rows): a 1 MiB window of short lines can carry
more rows than the browser can ever hold, so it replayed and re-captured on
every scroll-to-top with no 60 s back-off.
- Label a replayed bounded window 'tail' even when the capture was byte-capped,
so the banner keeps offering Load full history instead of calling the rest
unrecoverable.
- Pin GET /terminal?full=1&tail=<n> in the route tests: full-history source,
truncationReason 'tail', and the closing relative cursor move survive the cut.
- Log the bounded skip via _logScrollRouting('repull-skipped-bounded').
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A window cut at the tail size can be smaller than the browser's buffer
while tmux still holds more. The downgrade guard reads that as "tmux has
nothing more to give", which is true of an unbounded capture only, so a
bounded window reaching it marked the session exhausted and removed Load
full history from the banner.
The bounded skip now runs first, so such a window never reaches the
exhausted path, and it no longer writes banner state: relabelling it from
the bounded payload would call a terminal holding all of a Load full
history pull "the most recent 1 MiB".
A skipped window that came back truncated cannot reach anything older
than the browser shows, and every ask costs the server a synchronous
capture-pane of the whole history (tail is applied after the capture), so
it puts the session on the 60 s cooldown. An untruncated one keeps 4 s.
_replayWouldShrinkBuffer takes optional pre-estimated rows so a megabyte
capture is not scanned twice. CLAUDE.md's Full-scrollback replay entry no
longer says Shell never pulls on ordinary scroll.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A burst of output leaves a Shell pane with about one screen of browser
scrollback, because tmux repaints the burst instead of scrolling it,
while tmux itself keeps every line. Shell declined the scroll-to-top
re-pull other modes use, and the Load full history button renders only
once a replay was truncated, so a Shell tab under 1 MiB could not
scroll back at all.
The scroll gesture now pulls ?full=1&tail=TERMINAL_TAIL_SIZE, the same
bound a tab switch loads; the route's existing tail cut marks longer
histories 'tail', so the banner still offers the unbounded pull. A
window no longer than the browser's buffer is not rewritten.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>