patch 8.2.2545: errors and crash when terminal window is zero height
Problem: Errors and crash when terminal window is zero height. (Leonid V.
Fedorenchik)
Solution: Do not resize when width or height is zero. (closes #7890)
diff --git a/src/terminal.c b/src/terminal.c
index 9729eac..4c43ea7 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3800,6 +3800,11 @@
newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows;
newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols;
+ // If no cell is visible there is no point in resizing. Also, vterm can't
+ // handle a zero height.
+ if (newrows == 0 || newcols == 0)
+ return;
+
if (term->tl_rows != newrows || term->tl_cols != newcols)
{
term->tl_vterm_size_changed = TRUE;