summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-02-21 10:30:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-02-21 10:30:16 +0000
commitc903de0f0e37b0271fd5bb5b6676ddcee816b720 (patch)
treee534782ac57b6b188b929d1fb2b86e42e7c3af5b /usr.bin/tmux
parentaed7e5dd1a9d8636c7eb14d111a4c931fbf288c1 (diff)
Scrolling at least needs to be flushed before sending EL to the terminal
(but it is simpler to flush everything, so do that instead).
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/screen-write.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index bb9f1b71a07..12bbe26f4f9 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.113 2017/02/16 12:43:08 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.114 2017/02/21 10:30:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -741,6 +741,7 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
screen_write_collect_clear(ctx, s->cy, 1);
+ screen_write_collect_flush(ctx, 0);
tty_write(tty_cmd_clearline, &ttyctx);
}
@@ -764,8 +765,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg)
if (s->cx == 0)
screen_write_collect_clear(ctx, s->cy, 1);
- else
- screen_write_collect_flush(ctx, 0);
+ screen_write_collect_flush(ctx, 0);
tty_write(tty_cmd_clearendofline, &ttyctx);
}
@@ -787,8 +787,7 @@ screen_write_clearstartofline(struct screen_write_ctx *ctx, u_int bg)
if (s->cx > sx - 1)
screen_write_collect_clear(ctx, s->cy, 1);
- else
- screen_write_collect_flush(ctx, 0);
+ screen_write_collect_flush(ctx, 0);
tty_write(tty_cmd_clearstartofline, &ttyctx);
}
@@ -863,6 +862,9 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped)
else
gl->flags &= ~GRID_LINE_WRAPPED;
+ log_debug("%s: at %u,%u (region %u-%u)", __func__, s->cx, s->cy,
+ s->rupper, s->rlower);
+
if (s->cy == s->rlower) {
grid_view_scroll_region_up(gd, s->rupper, s->rlower);
screen_write_collect_scroll(ctx);
@@ -999,7 +1001,7 @@ screen_write_collect_clear(struct screen_write_ctx *ctx, u_int y, u_int n)
free(ci);
}
ctx->skipped += size;
- log_debug("discarding %zu bytes on line %u", size, i);
+ log_debug("%s: dropped %zu bytes (line %u)", __func__, size, i);
}
}
@@ -1011,6 +1013,9 @@ screen_write_collect_scroll(struct screen_write_ctx *ctx)
struct screen_write_collect_line *cl;
u_int y;
+ log_debug("%s: at %u,%u (region %u-%u)", __func__, s->cx, s->cy,
+ s->rupper, s->rlower);
+
screen_write_collect_clear(ctx, s->rupper, 1);
for (y = s->rupper; y < s->rlower; y++) {
cl = &ctx->list[y + 1];
@@ -1122,6 +1127,7 @@ screen_write_collect_add(struct screen_write_ctx *ctx,
if (s->cx > sx - 1 || ctx->item->used > sx - 1 - s->cx)
screen_write_collect_end(ctx);
if (s->cx > sx - 1) {
+ log_debug("%s: wrapped at %u,%u", __func__, s->cx, s->cy);
screen_write_linefeed(ctx, 1);
s->cx = 0;
}