From 431322a26379822303de51de6f13da73e91f22d1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Dec 2016 12:00:33 +0530 Subject: [PATCH] Nicer window resize behavior when running a shell with a right side prompt --- kitty/window.py | 4 ++++ 1 file changed, 4 insertions(+) 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