diff --git a/src/Surface.zig b/src/Surface.zig index 04705dfbd..d60f4c620 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -894,14 +894,12 @@ pub fn sizeCallback(self: *Surface, size: apprt.SurfaceSize) !void { // Recalculate our grid size. Because Ghostty supports fluid resizing, // its possible the grid doesn't change at all even if the screen size changes. - const new_grid_size = renderer.GridSize.init( + // We have to update the IO thread no matter what because we send + // pixel-level sizing to the subprocess. + self.grid_size = renderer.GridSize.init( self.screen_size.subPadding(self.padding), self.cell_size, ); - if (self.grid_size.equals(new_grid_size)) return; - - // Grid size changed, update our grid size and notify the terminal - self.grid_size = new_grid_size; if (self.grid_size.columns < 5 and (self.padding.left > 0 or self.padding.right > 0)) { log.warn("WARNING: very small terminal grid detected with padding " ++ "set. Is your padding reasonable?", .{}); diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index e3aece1db..7e34bac7a 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -256,10 +256,14 @@ pub fn resize( screen_size: renderer.ScreenSize, padding: renderer.Padding, ) !void { - // Update the size of our pty + // Update the size of our pty. const padded_size = screen_size.subPadding(padding); try self.subprocess.resize(grid_size, padded_size); + // If our grid size didn't change, then we don't need to change + // the underlying terminal. + if (grid_size.equals(self.grid_size)) return; + // Update our cached grid size self.grid_size = grid_size;