Mercurial > vim
diff src/terminal.c @ 24006:d9afd9008910 v8.2.2545
patch 8.2.2545: errors and crash when terminal window is zero height
Commit: https://github.com/vim/vim/commit/eba13e4ea28f133ff65f6b426428f49a9bd711b0
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 23 17:47:23 2021 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 23 Feb 2021 18:00:03 +0100 |
parents | 139573353c6d |
children | 9257f3980f4a |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -3800,6 +3800,11 @@ term_update_window(win_T *wp) 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;