Severity: MEDIUM
Status: ✅ FIXED
Files: src/cmd/cmd.zig
const placeholder: ?*Pane = if (...) blk: {
const a = session.arenaAllocator();
const dummy = a.create(Pane) catch { ... };
dummy.* = Pane.init(a, 9999, 1, 1) catch { ... };
break :blk dummy;
} else null;
...
src_win.layout.root.leaf = dummy;
session.killWindow(server.allocator, src_win); // only deinits win.panes.items
placeholder is never in src_win.panes, never deinitd. With gpa this would be a hard leak; with the session arena it is retained bloat per join-pane-that-empties-source.
Avoid the dummy allocation (teach killWindow to handle an empty layout root), or explicitly dummy.deinit() after teardown when the layout no longer references it. Add a test asserting arena usage does not grow across repeated join/extract cycles.