diff options
Diffstat (limited to 'src/detached')
| -rw-r--r-- | src/detached/server.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/detached/server.zig b/src/detached/server.zig index bc293dce..db93e2e4 100644 --- a/src/detached/server.zig +++ b/src/detached/server.zig @@ -873,7 +873,8 @@ pub const Session = struct { fn writeFile(ctx: ?*anyopaque, pane: u8, path: []const u8, bytes: []const u8) void { const s = of(ctx); - if (!host_io.writeFileBytes(path, bytes)) return; + host_io.writeFileBytes(path, bytes) catch |err| + return s.core.saveFailed(pane, "save", err); // Our own write is about to come back as an inotify edge: restamp from // the bytes we just put there so the reconcile reads as "no change". // Only when this IS the pane's watched file — a `Save <elsewhere>` must @@ -898,7 +899,7 @@ pub const Session = struct { const s = of(ctx); var pbuf: [1024:0]u8 = undefined; const path = pardes.dump.outPath(&pbuf) orelse return; - if (!host_io.writeFileBytes(path, bytes)) return; + host_io.writeFileBytes(path, bytes) catch |err| return s.core.reportError(0, "dump", err); // Where it landed, which is what puts `Restore <path>` in the topbar // (pardes.zig `write_dump`). A dump of a detached session now lands in // the same directory a terminal session's does, rather than in whatever |
