From a15eabc3b9d98ef5f659ca82a2b0f2afb7451a39 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 16:47:19 -0300 Subject: A restored pane whose file is gone from disk comes back dirty, and Del asks before throwing its text away A dump keeps a pane's text. Restored after its file was deleted, the pane came back clean: the watch's baseline read of the missing file failed quietly, and Del closed it without a word. Its text was then nowhere at all. Restore now checks the file: a local path with nothing on disk comes back as one deleted on disk, as the watch would have said. It says so once, logs `changed N deleted`, and is dirty, so Del, Exit and Restore ask first. Co-Authored-By: Claude Opus 5.5 --- src/File.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/File.zig') diff --git a/src/File.zig b/src/File.zig index 2046a7cd..78c84287 100644 --- a/src/File.zig +++ b/src/File.zig @@ -888,6 +888,11 @@ pub fn restore(p: *Pardes, id: usize, src: dump.Pane) !*Pane { pane.cols = @max(1, src.cols); pane.rows = @max(1, src.rows); if (output == null and filesystem.localPath(path) != null) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = true, .mode = .baseline_disk } }); + // Its file gone from disk since the dump: its text is nowhere else now, + // so it comes back as one deleted on disk, dirty, and Del, Exit and + // Restore ask before throwing it away. + if (comptime pardes.hosted) if (output == null) if (filesystem.localPath(path)) |local| + if (@import("exec.zig").kindOf(local) == null) deleted(p, @intCast(id)); return pane; } -- cgit v1.3