mirror of
https://github.com/tmux/tmux.git
synced 2026-02-13 17:49:15 +00:00
Add support for applications to use synchronized output mode (DECSET
2026) to prevent screen tearing during rapid updates. When an application sends SM ?2026, tmux buffers output until RM ?2026 is received or a 1-second timeout expires. From Chris Lloyd with the assistance of Claude Code, GitHub issue 4744.
This commit is contained in:
10
input.c
10
input.c
@@ -898,6 +898,8 @@ input_free(struct input_ctx *ictx)
|
||||
evbuffer_free(ictx->since_ground);
|
||||
event_del(&ictx->ground_timer);
|
||||
|
||||
screen_write_stop_sync(ictx->wp);
|
||||
|
||||
free(ictx);
|
||||
}
|
||||
|
||||
@@ -1897,6 +1899,11 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx)
|
||||
case 2031:
|
||||
screen_write_mode_clear(sctx, MODE_THEME_UPDATES);
|
||||
break;
|
||||
case 2026: /* synchronized output */
|
||||
screen_write_stop_sync(ictx->wp);
|
||||
if (ictx->wp != NULL)
|
||||
ictx->wp->flags |= PANE_REDRAW;
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: unknown '%c'", __func__, ictx->ch);
|
||||
break;
|
||||
@@ -1995,6 +2002,9 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx)
|
||||
case 2031:
|
||||
screen_write_mode_set(sctx, MODE_THEME_UPDATES);
|
||||
break;
|
||||
case 2026: /* synchronized output */
|
||||
screen_write_start_sync(ictx->wp);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: unknown '%c'", __func__, ictx->ch);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user