diff --git a/screen-write.c b/screen-write.c index d25462df..324ad7d2 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1828,8 +1828,16 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only, u_int y, cx, cy, last, items = 0; struct tty_ctx ttyctx; - if (s->mode & MODE_SYNC) + if (s->mode & MODE_SYNC) { + for (y = 0; y < screen_size_y(s); y++) { + cl = &ctx->s->write_list[y]; + TAILQ_FOREACH_SAFE(ci, &cl->items, entry, tmp) { + TAILQ_REMOVE(&cl->items, ci, entry); + screen_write_free_citem(ci); + } + } return; + } if (ctx->scrolled != 0) { log_debug("%s: scrolled %u (region %u-%u)", __func__,