From 7fb385cb7882f79bd448250b176f2d3a81de64f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:55:26 -0300 Subject: terminal: resizeGrid takes the pane and the size, where it took an allocator too and threw it away (the emulator resizes with its state's own): the core's two calls (pardes.zig), the 9P pty's two and the kitty tests' two pass none Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/terminal.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/terminal.zig') diff --git a/src/terminal.zig b/src/terminal.zig index acc7efdf..29a28e85 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -687,7 +687,7 @@ pub fn followOutput(pane: *Pane) void { /// Reflow the grid. A failed reflow keeps the grid it had rather than dropping /// a scrollback; the next resize retries with the same numbers. -pub fn resizeGrid(pane: *Pane, gpa: std.mem.Allocator, cols: u16, rows: u16) void { +pub fn resizeGrid(pane: *Pane, cols: u16, rows: u16) void { if (comptime !enabled) return; if (authorityOnly("resize a terminal")) return; const state = pane.terminal orelse return; @@ -705,7 +705,6 @@ pub fn resizeGrid(pane: *Pane, gpa: std.mem.Allocator, cols: u16, rows: u16) voi return; } state.changes +%= 1; - _ = gpa; state.vt.resize(state.gpa, .{ .cols = cols, .rows = rows }) catch {}; } @@ -1065,7 +1064,7 @@ test "document construction allocates only the pane and has inert terminal defau try std.testing.expect(!promptInputReady(pane)); scrollGrid(pane, 100); followOutput(pane); - resizeGrid(pane, allocator, 80, 24); + resizeGrid(pane, 80, 24); try std.testing.expectEqual(GridCursor{}, gridCursor(pane)); try std.testing.expectEqual(Scrollbar{}, scrollbar(pane)); try std.testing.expectEqualStrings("", try screenTextAlloc(pane, allocator)); -- cgit v1.3