summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:55:26 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:02:08 -0300
commit7fb385cb7882f79bd448250b176f2d3a81de64f6 (patch)
tree780fc88e778de42722ec7377d554761b88af1991 /src/terminal.zig
parent1635d80290a48fddd4ae9f1de187e49cbd35f39b (diff)
downloadpardes-7fb385cb7882f79bd448250b176f2d3a81de64f6.tar.gz
pardes-7fb385cb7882f79bd448250b176f2d3a81de64f6.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig5
1 files changed, 2 insertions, 3 deletions
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));