summaryrefslogtreecommitdiff
path: root/core/Term.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 11:17:46 -0300
committerGabriel Schneider <[email protected]>2026-11-20 12:30:53 -0300
commit20f08450aee2487809feb6442ec44e21d2436e5d (patch)
treea6eda48cc7988b37019a98b914486cd04642e31a /core/Term.zig
parent35b2c0efc6c43ba44640f4432d98734000f8887a (diff)
parent23de206007ebae87007460afa993338781a03076 (diff)
downloadpardes-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.zig')
-rw-r--r--core/Term.zig13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/Term.zig b/core/Term.zig
index aa05a68f..6ef9b0a5 100644
--- a/core/Term.zig
+++ b/core/Term.zig
@@ -65,6 +65,12 @@ fn the() *const iface.Ops {
/// as it always has (`Parts` by name, then ghostty's snapshot).
pub const State = struct {
impl: *iface.State,
+ /// Written since its last reload (a feed, a reflow, a load: what cuts
+ /// its rows into pages), which a join reloads (panes.reloadTerminals,
+ /// the session's choice). One not holds the pages its last reload's
+ /// snapshot loads to, on every side, and so does a joiner loading the
+ /// same snapshot again from the dump.
+ written: bool = true,
/// The emulator as its program has made it, for the replay digest.
/// Under screen-state terminals the emulator is the authority's, and a
@@ -167,7 +173,9 @@ pub fn reload(s: *State) !u64 {
reloads.ns += dt;
reloads.worst_ns = @max(reloads.worst_ns, dt);
}
- return the().reload(s.impl);
+ const hash = try the().reload(s.impl);
+ s.written = false;
+ return hash;
}
/// When its next kitty animation frame is due (ms on the core's clock), as
@@ -180,6 +188,7 @@ pub fn due(s: *const State) ?u64 {
/// history marked off from what the next shell prints.
pub fn revive(s: *State) void {
writes +%= 1;
+ s.written = true;
the().revive(s.impl);
}
@@ -199,6 +208,7 @@ pub fn stop() void {
/// went).
pub fn feed(s: *State, bytes: []const u8, tracked: []const i32, rows: []i32, erased: []bool) Told {
writes +%= 1;
+ s.written = true;
return the().feed(s.impl, bytes, tracked, rows, erased);
}
@@ -229,6 +239,7 @@ pub fn follow(s: *State) void {
/// Its grid reflowed, now or when `resizeDeferred` makes it.
pub fn resize(s: *State, cols: u16, rows: u16, later: bool) void {
writes +%= 1;
+ s.written = true;
the().resize(s.impl, cols, rows, later);
}