When a cell is cleared after having been moved, we cannot reuse its

extended data, because that may still be in use. Add a flag to
grid_clear_cell to indicate this. Fixes irritating problems with ICH
(CSI @) mostly visible in emacs.
This commit is contained in:
nicm
2026-04-05 15:43:17 +00:00
parent 21da45e5c3
commit 4b0ff07bcb
3 changed files with 10 additions and 7 deletions

View File

@@ -760,8 +760,9 @@ screen_mode_to_string(int mode)
return (tmp);
}
/* Convert screen to a string. */
const char *
screen_print(struct screen *s)
screen_print(struct screen *s, int line)
{
static char *buf;
static size_t len = 16384;
@@ -777,6 +778,8 @@ screen_print(struct screen *s)
buf = xmalloc(len);
for (y = 0; y < screen_hsize(s) + s->grid->sy; y++) {
if (line >= 0 && y != (u_int)line)
continue;
n = snprintf(buf + last, len - last, "%.4d \"", y);
if (n <= 0 || (u_int)n >= len - last)
goto out;