diff options
author | 2020-04-16 13:35:24 +0000 | |
---|---|---|
committer | 2020-04-16 13:35:24 +0000 | |
commit | 76b45294daa0697c38f5d4cf0dbca272258fa195 (patch) | |
tree | b4012a15f4f226be43923faddfeb7775fc1339db /usr.bin/tmux/screen-write.c | |
parent | Make parse_unit return signed int (diff) | |
download | wireguard-openbsd-76b45294daa0697c38f5d4cf0dbca272258fa195.tar.xz wireguard-openbsd-76b45294daa0697c38f5d4cf0dbca272258fa195.zip |
Add support for the iTerm2 sychronized updates escape sequence which
drastically reduces flickering.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r-- | usr.bin/tmux/screen-write.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c index b065f27a024..a084d170efb 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.161 2020/04/15 16:11:23 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.162 2020/04/16 13:35:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -100,7 +100,8 @@ void screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp, struct screen *s) { - u_int y; + struct tty_ctx ttyctx; + u_int y; memset(ctx, 0, sizeof *ctx); @@ -129,18 +130,26 @@ screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp, screen_size_y(ctx->s)); } } + + screen_write_initctx(ctx, &ttyctx); + tty_write(tty_cmd_syncstart, &ttyctx); } /* Finish writing. */ void screen_write_stop(struct screen_write_ctx *ctx) { + struct tty_ctx ttyctx; + screen_write_collect_end(ctx); screen_write_collect_flush(ctx, 0); log_debug("%s: %u cells (%u written, %u skipped)", __func__, ctx->cells, ctx->written, ctx->skipped); + screen_write_initctx(ctx, &ttyctx); + tty_write(tty_cmd_syncend, &ttyctx); + free(ctx->item); free(ctx->list); /* flush will have emptied */ } |