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
......@@ -51,7 +51,7 @@ pub fn getTerminalSize(fd: i32) Resize {
5151 if (cross.c.ioctl(fd, cross.c.TIOCGWINSZ, &ws) == 0 and ws.ws_row > 0 and ws.ws_col > 0) {
5252 return .{ .rows = ws.ws_row, .cols = ws.ws_col, .xpixel = ws.ws_xpixel, .ypixel = ws.ws_ypixel };
5353 }
54- return .{ .rows = 24, .cols = 160 };
54+ return .{ .rows = 24, .cols = 120 };
5555 }
5656
5757 pub const MAX_CMD_LEN = 256;
+10, -2
......@@ -1126,7 +1126,11 @@ const Daemon = struct {
11261126 const saved_prompt_redraw = term.flags.shell_redraws_prompt;
11271127 term.flags.shell_redraws_prompt = .false;
11281128 defer term.flags.shell_redraws_prompt = saved_prompt_redraw;
1129- try term.resize(self.alloc, resize.cols, resize.rows);
1129+ const opts = ghostty_vt.Terminal.Resize{
1130+ .cols = resize.cols,
1131+ .rows = resize.rows,
1132+ };
1133+ try term.resize(self.alloc, opts);
11301134
11311135 // Mark that we've had a client init, so subsequent clients get terminal state
11321136 self.has_had_client = true;
......@@ -1162,7 +1166,11 @@ const Daemon = struct {
11621166 const saved_prompt_redraw = term.flags.shell_redraws_prompt;
11631167 term.flags.shell_redraws_prompt = .false;
11641168 defer term.flags.shell_redraws_prompt = saved_prompt_redraw;
1165- try term.resize(self.alloc, resize.cols, resize.rows);
1169+ const opts = ghostty_vt.Terminal.Resize{
1170+ .cols = resize.cols,
1171+ .rows = resize.rows,
1172+ };
1173+ try term.resize(self.alloc, opts);
11661174 std.log.debug("resize rows={d} cols={d}", .{ resize.rows, resize.cols });
11671175 }
11681176
+2, -2
......@@ -1279,7 +1279,7 @@ test "serializeTerminalState size mismatch roundtrip" {
12791279 defer term.deinit(alloc);
12801280
12811281 // Resize to 24 rows (simulates outer terminal being smaller)
1282- try term.resize(alloc, 80, 24);
1282+ try term.resize(alloc, ghostty_vt.Terminal.Resize{ .cols = 80, .rows = 24 });
12831283
12841284 var client = try serializeRoundtrip(alloc, &term);
12851285 defer client.deinit(alloc);
......@@ -1309,7 +1309,7 @@ test "serializeTerminalState scrollback + size mismatch nested roundtrip" {
13091309 }
13101310
13111311 // Resize inner to 24 rows (outer terminal is smaller)
1312- try inner.resize(alloc, 80, 24);
1312+ try inner.resize(alloc, ghostty_vt.Terminal.Resize{ .cols = 80, .rows = 24 });
13131313
13141314 const inner_cursor_x = inner.screens.active.cursor.x;
13151315 const inner_cursor_y = inner.screens.active.cursor.y;