terminal: resize to the max dimensions (#8249)

closes #8096
This commit is contained in:
Andrew Pyatkov
2018-04-16 13:25:23 -07:00
committed by Justin M. Keyes
parent 9a1f57b488
commit 84359a467f
2 changed files with 17 additions and 8 deletions

View File

@@ -359,6 +359,15 @@ void terminal_resize(Terminal *term, uint16_t width, uint16_t height)
return;
}
FOR_ALL_TAB_WINDOWS(tp, wp) {
if (wp->w_buffer && wp->w_buffer->terminal == term) {
const uint16_t win_width =
(uint16_t)(MAX(0, wp->w_width - win_col_off(wp)));
width = MAX(width, win_width);
height = (uint16_t)MAX(height, wp->w_height);
}
}
vterm_set_size(term->vt, height, width);
vterm_screen_flush_damage(term->vts);
term->pending_resize = true;