summaryrefslogtreecommitdiff
path: root/test/kitty.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
committerGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
commita479792a1ab2b593642d7f648194bfa23ce01dba (patch)
tree96ddee7d879a9084daa07db43b0b7910b072a785 /test/kitty.zig
parente179cc44fe5060c76a5b00c41e53f11209f5acd9 (diff)
parent4c761893e5b3fdae422622cfa02104ab36633045 (diff)
downloadpardes-a479792a1ab2b593642d7f648194bfa23ce01dba.tar.gz
pardes-a479792a1ab2b593642d7f648194bfa23ce01dba.zip
Merge the upstream daemon and replicated client/server refactor
Diffstat (limited to 'test/kitty.zig')
-rw-r--r--test/kitty.zig10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/kitty.zig b/test/kitty.zig
index de4dd605..1e1e8331 100644
--- a/test/kitty.zig
+++ b/test/kitty.zig
@@ -299,6 +299,8 @@ test "kitty: file, temporary-file and shared-memory media load, and the terminal
const fd = shm.shm_open(name, @bitCast(std.c.O{ .ACCMODE = .RDWR, .CREAT = true, .TRUNC = true }), 0o600);
if (fd < 0) return error.ShmOpenFailed;
defer _ = shm.shm_unlink(name);
+ // Sized first: FreeBSD's write does not grow a shared memory object.
+ if (ftruncate(fd, rgb_raw.len) != 0) return error.WriteFailed;
if (std.c.write(fd, &rgb_raw, rgb_raw.len) != rgb_raw.len) return error.WriteFailed;
_ = std.c.close(fd);
r.feed(0, try std.fmt.allocPrint(arena, "\x1b_Ga=t,t=s,i=43,f=24,s=4,v=2,S={d};{s}\x1b\\", .{ rgb_raw.len, try b64(arena, name) }));
@@ -847,6 +849,8 @@ test "kitty: a FIFO named by t=f, t=t or t=s never blocks pardes" {
.{ .medium = 's', .fifo = shm_path, .name = shm_path["/dev/shm".len..] },
};
for (cases) |c| {
+ // Shared memory is a directory only on Linux (/dev/shm).
+ if (c.medium == 's' and comptime @import("builtin").os.tag != .linux) continue;
_ = std.c.unlink(c.fifo);
if (mkfifo(c.fifo, 0o600) != 0) return error.MkfifoFailed;
defer _ = std.c.unlink(c.fifo);
@@ -1237,11 +1241,11 @@ test "kitty: a dumped and restored terminal keeps its images" {
defer r.deinit();
r.feed(0, "\x1b[1;1Hpicture" ++ apc("a=T,i=25,f=24,s=4,v=2,c=2,r=1,q=2", rgb_b64));
try pardes.dump.dumpState(r.p);
- const restored = try pardes.dump.restore(r.p, r.p.dump_out.?, "/tmp/pardes-kitty.dump.zon");
+ const restored = try pardes.dump.restore(r.p, r.p.dump_out.?, "/tmp/pardes-kitty.dump");
defer restored.deinit();
const pane = restored.panes[0].?;
- const kept = pane.terminal != null and pane.terminal.?.vt.screens.active.kitty_images.placements.count() > 0;
- try knownGap("a terminal's kitty images do not survive a dump (Dump/Load, Handover, a closed pane reopened from the Store): dumpPane writes the screen as VT text (ScreenFormatter), which has no images; ghostty's snapshot format carries them but is unstable (v1)", kept);
+ // ghostty's snapshot of the emulator (src/terminal.zig) carries them.
+ try std.testing.expect(pane.terminal.?.vt.screens.active.kitty_images.placements.count() > 0);
}
// ---- Real clients' traffic ----