Commit 22997b7
Eric Bower
·
2026-07-20 22:29:18 -0400 EDT
parent 62e7e56
fix: ghostty resize fn changes type sig
3 files changed,
+13,
-5
+1,
-1
1@@ -51,7 +51,7 @@ pub fn getTerminalSize(fd: i32) Resize {
2 if (cross.c.ioctl(fd, cross.c.TIOCGWINSZ, &ws) == 0 and ws.ws_row > 0 and ws.ws_col > 0) {
3 return .{ .rows = ws.ws_row, .cols = ws.ws_col, .xpixel = ws.ws_xpixel, .ypixel = ws.ws_ypixel };
4 }
5- return .{ .rows = 24, .cols = 160 };
6+ return .{ .rows = 24, .cols = 120 };
7 }
8
9 pub const MAX_CMD_LEN = 256;
+10,
-2
1@@ -1126,7 +1126,11 @@ const Daemon = struct {
2 const saved_prompt_redraw = term.flags.shell_redraws_prompt;
3 term.flags.shell_redraws_prompt = .false;
4 defer term.flags.shell_redraws_prompt = saved_prompt_redraw;
5- try term.resize(self.alloc, resize.cols, resize.rows);
6+ const opts = ghostty_vt.Terminal.Resize{
7+ .cols = resize.cols,
8+ .rows = resize.rows,
9+ };
10+ try term.resize(self.alloc, opts);
11
12 // Mark that we've had a client init, so subsequent clients get terminal state
13 self.has_had_client = true;
14@@ -1162,7 +1166,11 @@ const Daemon = struct {
15 const saved_prompt_redraw = term.flags.shell_redraws_prompt;
16 term.flags.shell_redraws_prompt = .false;
17 defer term.flags.shell_redraws_prompt = saved_prompt_redraw;
18- try term.resize(self.alloc, resize.cols, resize.rows);
19+ const opts = ghostty_vt.Terminal.Resize{
20+ .cols = resize.cols,
21+ .rows = resize.rows,
22+ };
23+ try term.resize(self.alloc, opts);
24 std.log.debug("resize rows={d} cols={d}", .{ resize.rows, resize.cols });
25 }
26
+2,
-2
1@@ -1279,7 +1279,7 @@ test "serializeTerminalState size mismatch roundtrip" {
2 defer term.deinit(alloc);
3
4 // Resize to 24 rows (simulates outer terminal being smaller)
5- try term.resize(alloc, 80, 24);
6+ try term.resize(alloc, ghostty_vt.Terminal.Resize{ .cols = 80, .rows = 24 });
7
8 var client = try serializeRoundtrip(alloc, &term);
9 defer client.deinit(alloc);
10@@ -1309,7 +1309,7 @@ test "serializeTerminalState scrollback + size mismatch nested roundtrip" {
11 }
12
13 // Resize inner to 24 rows (outer terminal is smaller)
14- try inner.resize(alloc, 80, 24);
15+ try inner.resize(alloc, ghostty_vt.Terminal.Resize{ .cols = 80, .rows = 24 });
16
17 const inner_cursor_x = inner.screens.active.cursor.x;
18 const inner_cursor_y = inner.screens.active.cursor.y;