diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 11:17:46 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 12:30:53 -0300 |
| commit | 20f08450aee2487809feb6442ec44e21d2436e5d (patch) | |
| tree | a6eda48cc7988b37019a98b914486cd04642e31a /core/term | |
| parent | 35b2c0efc6c43ba44640f4432d98734000f8887a (diff) | |
| parent | 23de206007ebae87007460afa993338781a03076 (diff) | |
| download | pardes-20f08450aee2487809feb6442ec44e21d2436e5d.tar.gz pardes-20f08450aee2487809feb6442ec44e21d2436e5d.zip | |
integration (the terminals' line, NOT the main line yet): a client that falls behind lets go and joins again, a join's reloads never dropped and only of the terminals written, on the first client and the pair: pardes-term-join (with pardes-term-lag under it) and pardes-merge35; three conflicts, each two sides adding at one place: the tests at the end of core/replica.zig (both kept), the soak's fields and its end's checks in test/replicas.zig (the images' and the far client's both kept); one name follows: Peer.writeLoop's local for a cut link was named last, which the first client's Peer.last now is (cut_off); tui core-test 861/1018 (157 skipped), shell-test 1058/1061, term-test 18/18, the window builds; the soak, screen state: diverged 0, unequal 0, unlisted 0; BYTES: seed 0 at 30 ms two clients diverged (client 2 at digest 29, client 3 at digest 2): the divergence the join's report left open, here on the merged session: this line stays beside the main one until that soak is clean
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/term')
| -rw-r--r-- | core/term/terminal.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/term/terminal.zig b/core/term/terminal.zig index e57193a6..1673a3d8 100644 --- a/core/term/terminal.zig +++ b/core/term/terminal.zig @@ -1792,3 +1792,34 @@ test "a join at a cut: every side reloaded from its own snapshot holds the same // another terminal once heavy colour has pruned pages cut otherwise. try std.testing.expectEqual(2, heavy_apart); } + +test "wide characters filling a scrollback past its limit, reflowed: its snapshot loads to the same snapshot and hash, and goes on as the same terminal through more bytes and reflows" { + // The soak's `cat` (test/replicas.zig): source lines, one in a few + // hundred with wide characters (CJK, box drawing, ambiguous symbols), + // a full scrollback pruned a page at a time, reflowed at odd widths + // where a wide character meets the right edge. + const gpa = std.testing.allocator; + var out: std.Io.Writer.Allocating = .init(gpa); + defer out.deinit(); + const wide = " try writeText(notes, \"# Fallback faces and rules\\n\\n| name | glyphs |\\n|------|--------|\\n| cjk | \u{754C}\u{9762}\u{5B57} |\\n| sym | \u{222E} \u{2260} \u{2605} |\\n\\n\u{250C}\u{2500}\u{2500}\u{252C}\u{2500}\u{2500}\u{2510}\\n\u{2502} a\u{2502} b\u{2502}\\n\u{2514}\u{2500}\u{2500}\u{2534}\u{2500}\u{2500}\u{2518}\\n\");"; + for (0..30000) |i| { + if (i % 7 == 3) try out.writer.print("{s}\r\n", .{wide}) else try out.writer.print("{s} {d}\r\n", .{ " const line = std.fmt.bufPrint(&buf, \"{d}\", .{i}) catch continue;"[0 .. 8 + i % 60], i }); + } + const bytes = out.written(); + const stops: [2]usize = .{ bytes.len / 3, 2 * bytes.len / 3 }; + const first = try openKeeping(gpa, 121, 40, 1 << 20); + defer close(first); + feedReflowing(first, bytes, 0, bytes.len / 2, stops); + const snap = try snapshotOf(gpa, first); + defer gpa.free(snap); + const loaded = try load(gpa, snap, &parts(first)); + defer close(loaded); + const again = try snapshotOf(gpa, loaded); + defer gpa.free(again); + try std.testing.expectEqualSlices(u8, snap, again); + try std.testing.expectEqual(joinHash(snap), try reload(first)); + try expectSame(gpa, first, loaded); + feedReflowing(first, bytes, bytes.len / 2, bytes.len, stops); + feedReflowing(loaded, bytes, bytes.len / 2, bytes.len, stops); + try expectSame(gpa, first, loaded); +} |
