diff --git a/kitty/window.py b/kitty/window.py index 8ca134678..4a11fa6dd 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -65,6 +65,10 @@ class Window: def set_geometry(self, new_geometry): if self.needs_layout or new_geometry.xnum != self.screen.columns or new_geometry.ynum != self.screen.lines: self.screen.resize(new_geometry.ynum, new_geometry.xnum) + if self.screen.cursor.y > 0: + # We move the cursor once line down to prevent the shell from + # overwriting the contents of the last line + self.screen.index() self.child.resize_pty(self.screen.columns, self.screen.lines) self.char_grid.resize(new_geometry) self.needs_layout = False