From 110a6dd6f080686f85df9dff16fbb06fe2f57a81 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 8 Dec 2022 13:49:38 +0100 Subject: grid: resize without reflow: truncate shell_integration.cmd_{start,end} This ensures the cmd start/end columns are valid in the new grid. --- grid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grid.c b/grid.c index f14580ad..e0e357dc 100644 --- a/grid.c +++ b/grid.c @@ -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 */ -- cgit v1.3