Nicer window resize behavior when running a shell with a right side prompt

This commit is contained in:
Kovid Goyal
2016-12-11 12:00:33 +05:30
parent e3ba45d903
commit 431322a263

View File

@@ -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