mirror of
https://github.com/tmux/tmux.git
synced 2025-12-22 07:16:06 +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:
15
format.c
15
format.c
@@ -1947,6 +1947,18 @@ format_cb_origin_flag(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for synchronized_output_flag. */
|
||||
static void *
|
||||
format_cb_synchronized_output_flag(struct format_tree *ft)
|
||||
{
|
||||
if (ft->wp != NULL) {
|
||||
if (ft->wp->base.mode & MODE_SYNC)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_active. */
|
||||
static void *
|
||||
format_cb_pane_active(struct format_tree *ft)
|
||||
@@ -3439,6 +3451,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "start_time", FORMAT_TABLE_TIME,
|
||||
format_cb_start_time
|
||||
},
|
||||
{ "synchronized_output_flag", FORMAT_TABLE_STRING,
|
||||
format_cb_synchronized_output_flag
|
||||
},
|
||||
{ "tree_mode_format", FORMAT_TABLE_STRING,
|
||||
format_cb_tree_mode_format
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user