grid: resize without reflow: truncate shell_integration.cmd_{start,end}

This ensures the cmd start/end columns are valid in the new grid.
This commit is contained in:
Daniel Eklöf 2022-12-08 13:49:38 +01:00
parent d5308a0493
commit 110a6dd6f0
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

4
grid.c
View file

@ -427,7 +427,9 @@ grid_resize_without_reflow(
new_row->dirty = old_row->dirty;
new_row->linebreak = false;
new_row->shell_integration = old_row->shell_integration;
new_row->shell_integration.prompt_marker = old_row->shell_integration.prompt_marker;
new_row->shell_integration.cmd_start = min(old_row->shell_integration.cmd_start, new_cols - 1);
new_row->shell_integration.cmd_end = min(old_row->shell_integration.cmd_end, new_cols - 1);
if (new_cols > old_cols) {
/* Clear "new" columns */