=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -r1.117 -r1.118 --- src/usr.bin/tmux/screen-write.c 2017/04/22 10:30:56 1.117 +++ src/usr.bin/tmux/screen-write.c 2017/04/25 18:30:29 1.118 @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.117 2017/04/22 10:30:56 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.118 2017/04/25 18:30:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -41,6 +41,7 @@ struct screen_write_collect_item { u_int x; + int wrapped; u_int used; char data[256]; @@ -1054,6 +1055,7 @@ screen_write_cursormove(ctx, ci->x, y); screen_write_initctx(ctx, &ttyctx); ttyctx.cell = &ci->gc; + ttyctx.wrapped = ci->wrapped; ttyctx.ptr = ci->data; ttyctx.num = ci->used; tty_write(tty_cmd_cells, &ttyctx); @@ -1133,13 +1135,15 @@ if (s->cx > sx - 1 || ctx->item->used > sx - 1 - s->cx) screen_write_collect_end(ctx); + ci = ctx->item; /* may have changed */ + if (s->cx > sx - 1) { log_debug("%s: wrapped at %u,%u", __func__, s->cx, s->cy); + ci->wrapped = 1; screen_write_linefeed(ctx, 1); s->cx = 0; } - ci = ctx->item; /* may have changed */ if (ci->used == 0) memcpy(&ci->gc, gc, sizeof ci->gc); ci->data[ci->used++] = gc->data.data[0];