From 7103e6f659f8d56d6d5101593f1c97dd054d13b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Oct 2016 06:49:47 +0530 Subject: [PATCH] Preserve cursor poistion on resize --- kitty/screen.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kitty/screen.py b/kitty/screen.py index 43fed7e59..69b804254 100644 --- a/kitty/screen.py +++ b/kitty/screen.py @@ -136,7 +136,13 @@ class Screen(QObject): self.tophistorybuf.extend(self.linebuf[:extra]) del self.linebuf[:extra] self.margins = Margins(0, self.lines - 1) - self.reset_mode(mo.DECOM) + self._notify_cursor_position = False + try: + x, y = self.cursor.x, self.cursor.y + self.reset_mode(mo.DECOM) + self.cursor.x, self.cursor.y = x, y + finally: + self._notify_cursor_position = True self.ensure_bounds() def set_margins(self, top=None, bottom=None):