aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-20 14:59:31 +0000
committernicm <nicm>2020-04-20 14:59:31 +0000
commit2083a6ea2050fb211eab3da0df0ff5a40b4973b4 (patch)
tree48550eab5ba7e22d2b0817d6a164935f09eea5ad /tty.c
parent135bb1edeeab3faae8001100aa7c173be9aa91e1 (diff)
downloadrtmux-2083a6ea2050fb211eab3da0df0ff5a40b4973b4.tar.gz
rtmux-2083a6ea2050fb211eab3da0df0ff5a40b4973b4.tar.bz2
rtmux-2083a6ea2050fb211eab3da0df0ff5a40b4973b4.zip
Change how sync works to always send the end sequence after all output
is done when we are returning to the event loop (since we always move the cursor at that point). Also a man fix from jmc.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/tty.c b/tty.c
index e1c629ec..0214524c 100644
--- a/tty.c
+++ b/tty.c
@@ -1427,18 +1427,30 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
void
tty_sync_start(struct tty *tty)
{
- if ((~tty->flags & TTY_SYNCING) && tty_term_has(tty->term, TTYC_SYNC)) {
+ if (tty->flags & TTY_BLOCK)
+ return;
+ if (tty->flags & TTY_SYNCING)
+ return;
+ tty->flags |= TTY_SYNCING;
+
+ if (tty_term_has(tty->term, TTYC_SYNC)) {
+ log_debug("%s sync start", tty->client->name);
tty_putcode1(tty, TTYC_SYNC, 1);
- tty->flags |= TTY_SYNCING;
}
}
void
tty_sync_end(struct tty *tty)
{
- if ((tty->flags & TTY_SYNCING) && tty_term_has(tty->term, TTYC_SYNC)) {
+ if (tty->flags & TTY_BLOCK)
+ return;
+ if (~tty->flags & TTY_SYNCING)
+ return;
+ tty->flags &= ~TTY_SYNCING;
+
+ if (tty_term_has(tty->term, TTYC_SYNC)) {
+ log_debug("%s sync end", tty->client->name);
tty_putcode1(tty, TTYC_SYNC, 2);
- tty->flags &= ~TTY_SYNCING;
}
}
@@ -1952,12 +1964,6 @@ tty_cmd_syncstart(struct tty *tty, __unused const struct tty_ctx *ctx)
tty_sync_start(tty);
}
-void
-tty_cmd_syncend(struct tty *tty, __unused const struct tty_ctx *ctx)
-{
- tty_sync_end(tty);
-}
-
static void
tty_cell(struct tty *tty, const struct grid_cell *gc, struct window_pane *wp)
{