diff options
Diffstat (limited to 'core/Term.zig')
| -rw-r--r-- | core/Term.zig | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/Term.zig b/core/Term.zig index 89773f77..eabf5b81 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 @@ -155,7 +161,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 @@ -168,6 +176,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); } @@ -187,6 +196,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); } @@ -217,6 +227,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); } |
