summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 17:40:41 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitb196f602a6bbb53e0025140c7a3f9cbb9f23bcd2 (patch)
treef043d8d929c0083038e4bcb47b41d6b91608f44a /src/ninep/ctl.zig
parent13ef34f1c10a5880be411475cfabd7bb1344916b (diff)
downloadpardes-b196f602a6bbb53e0025140c7a3f9cbb9f23bcd2.tar.gz
pardes-b196f602a6bbb53e0025140c7a3f9cbb9f23bcd2.zip
Save path logs a save record naming the path it wrote
Save of a pane's own file logged `save <serial> <name>`, and so did a scratch's `Save path` (the pane takes that name). A `Save path` that writes a copy of a file pane, or a terminal's scrollback, elsewhere logged nothing, so a follower could not tell the file was written. It now logs `save <serial> <path>` with the path written, once the host has written it (events.noteLogAs). fs.md's log table says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index fdc83da8..10336e38 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1633,6 +1633,17 @@ test "get reloads the pane from disk and reports a missing file without losing d
try testing.expect(pane_files.dirtyOf(pane));
}
+test "Save path of a file pane logs a save record naming that path" {
+ const p = try withFile(testing.allocator, "one\n");
+ defer p.deinit();
+ const serial = serialOf(p);
+ const saved = wr(p, Node.of(serial, .ctl), "Save /tmp/pardes-save-copy.txt\n");
+ try testing.expectEqual(Status.ok, saved.reply.status);
+ p.perform(.{ .save_text = .{ .pane = 0, .serial = serial, .path = Pardes.SavePath.from("/tmp/pardes-save-copy.txt") } });
+ var want: [64]u8 = undefined;
+ try testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "save {d} /tmp/pardes-save-copy.txt\n", .{serial})));
+}
+
test "exec Save writes the named file through the host" {
const gpa = testing.allocator;
const p = try withFile(gpa, "one\ntwo\n");