summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen-redraw.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-16 13:35:24 +0000
committernicm <nicm@openbsd.org>2020-04-16 13:35:24 +0000
commit76b45294daa0697c38f5d4cf0dbca272258fa195 (patch)
treeb4012a15f4f226be43923faddfeb7775fc1339db /usr.bin/tmux/screen-redraw.c
parentMake parse_unit return signed int (diff)
downloadwireguard-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-redraw.c')
-rw-r--r--usr.bin/tmux/screen-redraw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c
index cf2d88ff07f..436126f80a5 100644
--- a/usr.bin/tmux/screen-redraw.c
+++ b/usr.bin/tmux/screen-redraw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-redraw.c,v 1.66 2020/03/24 08:09:44 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.67 2020/04/16 13:35:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -435,6 +435,7 @@ screen_redraw_screen(struct client *c)
flags = screen_redraw_update(c, c->flags);
screen_redraw_set_context(c, &ctx);
+ tty_sync_start(&c->tty);
if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) {
if (ctx.pane_status != PANE_STATUS_OFF)
@@ -448,7 +449,9 @@ screen_redraw_screen(struct client *c)
screen_redraw_draw_status(&ctx);
if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY))
c->overlay_draw(c, &ctx);
+
tty_reset(&c->tty);
+ tty_sync_end(&c->tty);
}
/* Redraw a single pane. */
@@ -461,9 +464,12 @@ screen_redraw_pane(struct client *c, struct window_pane *wp)
return;
screen_redraw_set_context(c, &ctx);
+ tty_sync_start(&c->tty);
screen_redraw_draw_pane(&ctx, wp);
+
tty_reset(&c->tty);
+ tty_sync_end(&c->tty);
}
/* Draw a border cell. */