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 { | |
| 51 | 51 | if (cross.c.ioctl(fd, cross.c.TIOCGWINSZ, &ws) == 0 and ws.ws_row > 0 and ws.ws_col > 0) { | |
| 52 | 52 | return .{ .rows = ws.ws_row, .cols = ws.ws_col, .xpixel = ws.ws_xpixel, .ypixel = ws.ws_ypixel }; | |
| 53 | 53 | } | |
| 54 | - | return .{ .rows = 24, .cols = 160 }; | |
| 54 | + | return .{ .rows = 24, .cols = 120 }; | |
| 55 | 55 | } | |
| 56 | 56 | ||
| 57 | 57 | pub const MAX_CMD_LEN = 256; |
+10,
-2
| ... | ... | @@ -1126,7 +1126,11 @@ const Daemon = struct { | |
| 1126 | 1126 | const saved_prompt_redraw = term.flags.shell_redraws_prompt; | |
| 1127 | 1127 | term.flags.shell_redraws_prompt = .false; | |
| 1128 | 1128 | 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); | |
| 1130 | 1134 | ||
| 1131 | 1135 | // Mark that we've had a client init, so subsequent clients get terminal state | |
| 1132 | 1136 | self.has_had_client = true; |
| ... | ... | @@ -1162,7 +1166,11 @@ const Daemon = struct { | |
| 1162 | 1166 | const saved_prompt_redraw = term.flags.shell_redraws_prompt; | |
| 1163 | 1167 | term.flags.shell_redraws_prompt = .false; | |
| 1164 | 1168 | 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); | |
| 1166 | 1174 | std.log.debug("resize rows={d} cols={d}", .{ resize.rows, resize.cols }); | |
| 1167 | 1175 | } | |
| 1168 | 1176 |
+2,
-2
| ... | ... | @@ -1279,7 +1279,7 @@ test "serializeTerminalState size mismatch roundtrip" { | |
| 1279 | 1279 | defer term.deinit(alloc); | |
| 1280 | 1280 | ||
| 1281 | 1281 | // 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 }); | |
| 1283 | 1283 | ||
| 1284 | 1284 | var client = try serializeRoundtrip(alloc, &term); | |
| 1285 | 1285 | defer client.deinit(alloc); |
| ... | ... | @@ -1309,7 +1309,7 @@ test "serializeTerminalState scrollback + size mismatch nested roundtrip" { | |
| 1309 | 1309 | } | |
| 1310 | 1310 | ||
| 1311 | 1311 | // 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 }); | |
| 1313 | 1313 | ||
| 1314 | 1314 | const inner_cursor_x = inner.screens.active.cursor.x; | |
| 1315 | 1315 | const inner_cursor_y = inner.screens.active.cursor.y; |