term: ptmx: don’t consume anything while doing an interactive resize

The ‘normal’ grid in use during an interactive resize is temporary;
all changes done to it will be lost when the resize is finished.
This commit is contained in:
Daniel Eklöf 2022-10-09 16:15:29 +02:00
parent 66e4592d91
commit 54d637e2b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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)) {
/*
* Dont consume PTMX while were doing an interactive resize,
* since the normal grid were 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);
}