=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/input.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- src/usr.bin/tmux/input.c 2017/02/08 15:49:29 1.113 +++ src/usr.bin/tmux/input.c 2017/02/08 16:45:18 1.114 @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.113 2017/02/08 15:49:29 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.114 2017/02/08 16:45:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -896,6 +896,16 @@ } /* + * Any state except print stops the current collection. This is + * an optimization to avoid checking if the attributes have + * changed for every character. It will stop unnecessarily for + * sequences that don't make a terminal change, but they should + * be the minority. + */ + if (itr->handler != input_print) + screen_write_collect_end(&ictx->ctx); + + /* * Execute the handler, if any. Don't switch state if it * returns non-zero. */ @@ -1020,7 +1030,7 @@ ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; utf8_set(&ictx->cell.cell.data, ictx->ch); - screen_write_cell(&ictx->ctx, &ictx->cell.cell); + screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET;