=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.115 retrieving revision 1.116 diff -c -r1.115 -r1.116 *** src/usr.bin/tmux/screen-write.c 2017/03/06 09:02:36 1.115 --- src/usr.bin/tmux/screen-write.c 2017/03/07 13:48:28 1.116 *************** *** 1,4 **** ! /* $OpenBSD: screen-write.c,v 1.115 2017/03/06 09:02:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen-write.c,v 1.116 2017/03/07 13:48:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1030,1037 **** { struct screen *s = ctx->s; struct screen_write_collect_item *ci, *tmp; ! u_int y, cx, cy; struct tty_ctx ttyctx; if (ctx->scrolled != 0) { log_debug("%s: scrolled %u (region %u-%u)", __func__, --- 1030,1038 ---- { struct screen *s = ctx->s; struct screen_write_collect_item *ci, *tmp; ! u_int y, cx, cy, items = 0; struct tty_ctx ttyctx; + size_t written = 0; if (ctx->scrolled != 0) { log_debug("%s: scrolled %u (region %u-%u)", __func__, *************** *** 1056,1068 **** ttyctx.ptr = ci->data; ttyctx.num = ci->used; tty_write(tty_cmd_cells, &ttyctx); - ctx->written += ci->used; TAILQ_REMOVE(&ctx->list[y].items, ci, entry); free(ci); } } s->cx = cx; s->cy = cy; } /* Finish and store collected cells. */ --- 1057,1074 ---- ttyctx.ptr = ci->data; ttyctx.num = ci->used; tty_write(tty_cmd_cells, &ttyctx); + items++; + written += ci->used; + TAILQ_REMOVE(&ctx->list[y].items, ci, entry); free(ci); } } s->cx = cx; s->cy = cy; + + log_debug("%s: flushed %u items (%zu bytes)", __func__, items, written); + ctx->written += written; } /* Finish and store collected cells. */ *************** *** 1101,1109 **** /* * Don't need to check that the attributes and whatnot are still the ! * same - input_parse will do a flush when anything that isn't a plain ! * character is encountered. Also nothing should make it here that ! * isn't a single ASCII character. */ collect = 1; --- 1107,1115 ---- /* * Don't need to check that the attributes and whatnot are still the ! * same - input_parse will end the collection when anything that isn't ! * a plain character is encountered. Also nothing should make it here ! * that isn't a single ASCII character. */ collect = 1; *************** *** 1119,1124 **** --- 1125,1131 ---- collect = 0; if (!collect) { screen_write_collect_end(ctx); + screen_write_collect_flush(ctx, 0); screen_write_cell(ctx, gc); return; }