diff options
author | 2020-04-18 06:20:50 +0000 | |
---|---|---|
committer | 2020-04-18 06:20:50 +0000 | |
commit | 6d02ba1306908d4527a3625d9a617326e8f0066b (patch) | |
tree | e615b7e748616b639cab07c0169b1c4d3b878086 | |
parent | Revert previous, there is still a problem. (diff) | |
download | wireguard-openbsd-6d02ba1306908d4527a3625d9a617326e8f0066b.tar.xz wireguard-openbsd-6d02ba1306908d4527a3625d9a617326e8f0066b.zip |
Add a flag to protect against nested syncs and add some extra logging to
redrawing.
-rw-r--r-- | usr.bin/tmux/screen-redraw.c | 15 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 10 |
4 files changed, 22 insertions, 9 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c index 4f6404d5f42..f688f1786ba 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.69 2020/04/18 06:15:07 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.70 2020/04/18 06:20:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -438,17 +438,24 @@ screen_redraw_screen(struct client *c) tty_sync_start(&c->tty); if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) { + log_debug("%s: redrawing borders", c->name); if (ctx.pane_status != PANE_STATUS_OFF) screen_redraw_draw_pane_status(&ctx); screen_redraw_draw_borders(&ctx); } - if (flags & CLIENT_REDRAWWINDOW) + if (flags & CLIENT_REDRAWWINDOW) { + log_debug("%s: redrawing panes", c->name); screen_redraw_draw_panes(&ctx); + } if (ctx.statuslines != 0 && - (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS))) + (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS))) { + log_debug("%s: redrawing status", c->name); screen_redraw_draw_status(&ctx); - if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY)) + } + if (c->overlay_draw != NULL && (flags & CLIENT_REDRAWOVERLAY)) { + log_debug("%s: redrawing overlay", c->name); c->overlay_draw(c, &ctx); + } tty_reset(&c->tty); tty_sync_end(&c->tty); diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index c23048c69a4..ee48a88aa94 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.322 2020/04/18 06:15:07 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.323 2020/04/18 06:20:50 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1741,6 +1741,7 @@ server_client_check_redraw(struct client *c) */ TAILQ_FOREACH(wp, &c->session->curw->window->panes, entry) { if (wp->flags & PANE_REDRAW) { + log_debug("%s: redrawing pane %%%u", __func__, wp->id); tty_update_mode(tty, tty->mode, NULL); screen_redraw_pane(c, wp); } diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 4044ece63df..37d2536e3f4 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1003 2020/04/18 06:15:07 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1004 2020/04/18 06:20:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1244,6 +1244,7 @@ struct tty { #define TTY_BLOCK 0x80 #define TTY_HAVEDA 0x100 #define TTY_HAVEDSR 0x200 +#define TTY_SYNCING 0x400 int flags; struct tty_term *term; diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index adb962cfe1c..c438a38f607 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.356 2020/04/18 06:15:07 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.357 2020/04/18 06:20:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1438,15 +1438,19 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s, void tty_sync_start(struct tty *tty) { - if (tty_get_flags(tty) & TERM_SYNC) + if ((~tty->flags & TTY_SYNCING) && (tty_get_flags(tty) & TERM_SYNC)) { tty_puts(tty, "\033P=1s\033\\"); + tty->flags |= TTY_SYNCING; + } } void tty_sync_end(struct tty *tty) { - if (tty_get_flags(tty) & TERM_SYNC) + if (tty_get_flags(tty) & TERM_SYNC) { tty_puts(tty, "\033P=2s\033\\"); + tty->flags &= ~TTY_SYNCING; + } } static int |