From 54d637e2b47fd55e4abde1e28f7f665e69c2a995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 9 Oct 2022 16:15:29 +0200 Subject: [PATCH] =?UTF-8?q?term:=20ptmx:=20don=E2=80=99t=20consume=20anyth?= =?UTF-8?q?ing=20while=20doing=20an=20interactive=20resize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ‘normal’ grid in use during an interactive resize is temporary; all changes done to it will be lost when the resize is finished. --- terminal.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/terminal.c b/terminal.c index 5dd261bb..4fb13f44 100644 --- a/terminal.c +++ b/terminal.c @@ -268,6 +268,16 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) cursor_blink_rearm_timer(term); } + if (unlikely(term->interactive_resizing.grid != NULL)) { + /* + * Don’t consume PTMX while we’re doing an interactive resize, + * since the ‘normal’ grid we’re currently using is a + * temporary one - all changes done to it will be lost when + * the interactive resize ends. + */ + return 0; + } + uint8_t buf[24 * 1024]; const size_t max_iterations = !hup ? 10 : SIZE_MAX; @@ -291,6 +301,7 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) break; } + xassert(term->interactive_resizing.grid == NULL); vt_from_slave(term, buf, count); }