summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 12:44:57 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit6fc9f416938b59b665b1fddc052402770a21cc3f (patch)
tree632e83ae787b6e1d231683514663188d3e73e4b9 /src/pardes.zig
parentc8a3ecc3bcb36f0259f4d8ad2e0cdfcdc3183c9f (diff)
downloadpardes-6fc9f416938b59b665b1fddc052402770a21cc3f.tar.gz
pardes-6fc9f416938b59b665b1fddc052402770a21cc3f.zip
A Restore answers its writer before hanging up, and the log records dumps and restores
A client that wrote Restore saw its connection cut with no answer, and could not tell a Restore from a crash. The listener now lets the writer's answer out before the cut, and cuts only the old editor's connections, refusing their requests meanwhile; a client that dials during it is the new editor's and stays. Dump logs 'dump <path>' and the restored editor's log 'restore <path>'. Keeping connections across a Restore was weighed and left: the fids name the old editor's panes and opens, so it would mean carrying serials and open records into the new one, where acme's Load only adds windows. tty's Restore also closed its shells' ptys without reaping them; it retires them now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 6e78380a..c049fa39 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -1770,7 +1770,7 @@ test "owned cwd restore either copies the directory or preserves the old core" {
for (0..256) |failure| {
allocator.has_induced_failure = false;
allocator.fail_index = allocator.alloc_index + failure;
- const replacement = dump.restore(p, p.dump_out.?) catch {
+ const replacement = dump.restore(p, p.dump_out.?, "test") catch {
try std.testing.expect(allocator.has_induced_failure);
try std.testing.expectEqual(original, p.panes[0].?);
try std.testing.expectEqualStrings("/retained/terminal/directory", original.cwdSlice());
@@ -2722,14 +2722,14 @@ test "editable workspace and column tags are typed into and persist" {
try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, 0), "Grep New"));
try std.testing.expectEqualStrings("untouched\n", p.panes[0].?.file.?.content);
try dump.dumpState(p);
- const restored = try dump.restore(p, p.dump_out.?);
+ const restored = try dump.restore(p, p.dump_out.?, "test");
defer restored.deinit();
try std.testing.expectEqualStrings(p.global_tag.own.?, restored.global_tag.own.?);
try std.testing.expectEqualStrings(tagline.columnTag(p, 0), tagline.columnTag(restored, 0));
p.gpa.free(p.col_tags[0].own.?);
p.col_tags[0].own = try p.gpa.dupe(u8, "");
try dump.dumpState(p);
- const empty = try dump.restore(p, p.dump_out.?);
+ const empty = try dump.restore(p, p.dump_out.?, "test");
defer empty.deinit();
try std.testing.expectEqualStrings("", tagline.columnTag(empty, 0));
}
@@ -4095,6 +4095,7 @@ pub const Pardes = struct {
const copy = p.gpa.dupe(u8, path) catch return;
if (p.last_dump) |old| p.gpa.free(old);
p.last_dump = copy;
+ ctlfs.events.notePath(p, "dump", path);
}
/// the shell polls this each frame: a pending Restore's dump path, or null