mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Add support for the iTerm2 sychronized updates escape sequence which
drastically reduces flickering.
This commit is contained in:
26
tty.c
26
tty.c
@ -1426,6 +1426,20 @@ tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
|
||||
tty_update_mode(tty, tty->mode, s);
|
||||
}
|
||||
|
||||
void
|
||||
tty_sync_start(struct tty *tty)
|
||||
{
|
||||
if ((tty->term->flags|tty->term_flags) & TERM_SYNC)
|
||||
tty_puts(tty, "\033P=1s\033\\");
|
||||
}
|
||||
|
||||
void
|
||||
tty_sync_end(struct tty *tty)
|
||||
{
|
||||
if ((tty->term->flags|tty->term_flags) & TERM_SYNC)
|
||||
tty_puts(tty, "\033P=2s\033\\");
|
||||
}
|
||||
|
||||
static int
|
||||
tty_client_ready(struct client *c, struct window_pane *wp)
|
||||
{
|
||||
@ -1919,6 +1933,18 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx)
|
||||
tty_invalidate(tty);
|
||||
}
|
||||
|
||||
void
|
||||
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user