Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reflow destination guard. Adds
&& i >= 0to the_reflowSmallerinsertion loop (Buffer.ts) in the maintained@xterm/xtermand@xterm/headlesssource patches, sothis.lines.set(i--, …)can no longer write below logical row 0 (whichCircularList._getCyclicIndexmaps onto negative array properties and, for a rotated ring, valid rows). - Bundle/mobile regeneration. Desktop and mobile CJS/ESM bundle patches and maps carry the guard;
MOBILE_SOURCESnow includesBuffer.ts, and both lockfiles'patch_hashentries move with it. - Regression coverage. New
config/scripts/xterm-reflow-retention.test.mjsexercises installed headless and renderer builds across CJS and ESM at ring starts 0 and 37; a new mobile WebView test covers the 20-column floor. - Bounded audit proof.
docs/audits/xterm-reflow-retention/records a 192 MiB-capped reproduction, 28 parity cases, and 8 WeakRef lifecycle cases, with tested source hashes pinned invalidation.json.
Verification performed
- Confirmed exactly one
Buffer.tsstanza and onei >= 0hunk in each of the headless, desktop, and mobile source patches, and the guard present in the generated bundles. - Lock consistency holds: every
patch_hash(@xterm/headless,@xterm/xterm, mobile, and the untouched addon-webgl entry) equalssha256of its committed patch file, so a frozen install should resolve. - Removed the guard from the installed bundles and re-ran the new test: all eight cases fail with the wrong retained tail, so the assertion is not theatre (restored afterward).
validation.json'sproductSourceHashes["pnpm-lock.yaml"]is the tested lock (12ecbfeb…); the committed lock is the projected one (25529fae…), matchingpublicationProjection.projectedLockSha256and differing only by the base branch's unrelated addon-webgl entry, aspublicationProjection.differencestates.docs/reference/xterm-patch-regeneration.mdis updated for the added source stanza and file counts; no stale source-list references remain.
The author's explicit non-claims (no retroactive cleanup of properties in live buffers, no reduction of temporary reflow allocation, no incident attribution) are accurate and appropriately scoped.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The second commit (f893dc4a75) is test-only: it updates expectations the first commit's guard invalidated. Product scope is unchanged.
- Payload hash expectation.
mobile/src/terminal/terminal-webview-payload-hash.test.tsmoves to952197df…/731264(was241cb377…/731258); the +6 length delta matches the minified&&i>=0guard now in the generated engine. - Reflow/search regression expectation.
src/renderer/src/components/terminal-search-long-wrapped-line.test.tsno longer asserts the buggy state (_arraykeystoContain('-1'), inherited from the base branch); it now asserts zero negative keys plus the full retainedline 0..19tail.
Verification performed
- Re-ran the changed renderer file end-to-end: all 17 tests pass, including
stops rewinding at row 0 when a reflow trims a wrapped line head. - Re-ran
config/scripts/xterm-reflow-retention.test.mjs: 8/8 pass against the installed headless and renderer bundles (CJS + ESM, ring starts 0 and 37). - The flipped negative-key assertion is not theatre: the base branch asserted
toContain('-1')against the same pre-guard state, so it fails without the fix. - CI on
f893dc4a:testshards 1–8,typecheck,static analysis, andpackageall success. - I could not independently regenerate the mobile payload (mobile
node_modulesis absent on the runner), so the new hash/length is verified only by CI and by the arithmetic consistency above.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Resolve mobile lock metadata with the pnpm 12 hash format while retaining all patch hashes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Behavior
Stop xterm reflow from retaining rows under negative array indexes and overwriting the retained circular-buffer tail. Preserve the existing scrollback capacity and correctly retained terminal contents.
Validation
Real emitted desktop/headless CJS/ESM controls cover cursor, wrapping, markers and retained row contents. The current-main lockfile integration preserves the reviewed source and generated patch bytes.
Merge decision
Requires #20992, which requires #20981 and has a separately disclosed parser-performance cost. This correction adds no smaller history limit, but the stack is not an independent easy merge. Refreshed CI is required.
Audit evidence, Audit evidence, Audit evidence