Recalculate window sizes when the terminal reports its pixel size.

The reply to CSI 14t updated the client's cell size but not the windows,
which kept the default 16x32 cell size until some other event (a resize, or
any client connecting or exiting) triggered recalculate_sizes(). Images
parsed in the meantime were sized for the wrong cell and drawn at the wrong
size. Recalculate when the reply arrives, and extend the reply test to check
that the window follows the client without any other event.
This commit is contained in:
Michael Grant
2026-10-14 14:11:55 +02:00
parent 7e4dc561ca
commit 82d8c67504
2 changed files with 22 additions and 1 deletions

View File

@@ -1927,6 +1927,9 @@ tty_keys_winsz(struct tty *tty, const char *buf, size_t len, size_t *size,
tty_set_size(tty, tty->sx, tty->sy, char_x, char_y);
tty_invalidate(tty);
/* Windows take their cell size from the clients. */
recalculate_sizes();
tty->flags &= ~TTY_WINSIZEQUERY;
return (0);
}