Skip to content

Commit 5dea869

Browse files
test(web): reproduce issue 8701 scrollback loss
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3b95e78 commit 5dea869

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎apps/web/src/terminal/ghostty/core.test.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,28 @@ describe("GhosttyTerminalCore snapshots", () => {
366366
expect(core.snapshot()).toEqual(reference.snapshot());
367367
});
368368
});
369+
370+
describe("GhosttyTerminalCore scrollback", () => {
371+
it("retains thousands of rows of scrollback", async () => {
372+
const core = await GhosttyTerminalCore.create(
373+
80,
374+
10,
375+
8,
376+
16,
377+
{
378+
foreground: { r: 255, g: 255, b: 255 },
379+
background: { r: 0, g: 0, b: 0 },
380+
cursor: { r: 255, g: 255, b: 255 },
381+
},
382+
() => {},
383+
);
384+
try {
385+
core.write(Array.from({ length: 1_200 }, (_, index) => `${index}\r\n`).join(""));
386+
const scrollbar = core.scrollbarState();
387+
// The pinned ABI reads max_scrollback as bytes; a 10_000 budget kept ~600 rows here.
388+
expect(scrollbar!.total - scrollbar!.len).toBeGreaterThan(1_000);
389+
} finally {
390+
core.dispose();
391+
}
392+
});
393+
});

0 commit comments

Comments
 (0)