aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-18 06:20:50 +0000
committernicm <nicm>2020-04-18 06:20:50 +0000
commit1d2bd864f25a58ab85a6f9f0a448f3a69d8491cd (patch)
tree471efe39b17d06879738baa64fbb23f0bff51550 /tty.c
parentd94bdf7420eb6d0ef88783a35db2c592a3fccec0 (diff)
downloadrtmux-1d2bd864f25a58ab85a6f9f0a448f3a69d8491cd.tar.gz
rtmux-1d2bd864f25a58ab85a6f9f0a448f3a69d8491cd.tar.bz2
rtmux-1d2bd864f25a58ab85a6f9f0a448f3a69d8491cd.zip
Add a flag to protect against nested syncs and add some extra logging to
redrawing.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index 82436959..92827f5d 100644
--- a/tty.c
+++ b/tty.c
@@ -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