Files
tmux/regress
Michael GrantandClaude Sonnet 5 a7f74730d7 server-client: don't let a drag's own sync-start defer its redraw
server_client_key_callback()'s mouse-drag dispatch opens a
synchronized-output frame (tty_sync_start()) before running the drag
callback, on every single drag motion event - deliberately, so a fast-
path write and any later damage-composed correction land in one atomic
terminal update instead of two visible frames. But
server_client_check_redraw() later in the same pass checks
EVBUFFER_LENGTH(tty->out) != 0 to decide whether to defer this pass's
redraw, and nothing drains tty->out in between (the actual write
happens later, via libevent) - so the frame-open sequence just queued
(8 bytes: "\033[?2026h" on a synchronized-output-capable terminal)
makes that check see "outstanding output" and defer against itself,
escalating the drag's damage to a full-window redraw on every single
motion event. Confirmed via the server's own -vv log: a 6-step drag
produced five "redraw deferred (8 left)" lines, one per motion event,
with no fix.

Fix: record how much was already queued at the instant the sync frame
opened (tty->sync_offset), and have the redraw check discount
anything queued after that point - it's already part of the frame
this pass is committed to flushing, not a reason to defer. If the
buffer was genuinely non-empty before the frame opened, sync_offset
holds that real backlog and deferral still happens correctly.

regress/floating-pane-drag-sync-no-self-defer.sh drags a floating pane
on a synchronized-output-capable terminal and asserts the server log
never shows the self-inflicted 8-byte deferral. Verified failing 3/3
against the pre-fix code (5 occurrences per run, matching the manual
-vv repro) and passing 5/5 against the fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 10:06:09 +01:00
..
2026-09-20 09:19:35 +01:00
2026-08-28 08:56:12 +01:00
2026-09-08 08:32:05 +01:00
2026-09-01 20:52:44 +01:00
2026-09-02 11:16:47 +01:00
2026-09-02 12:32:29 +01:00
2026-09-02 11:16:47 +01:00
2025-12-07 22:11:45 +00:00
2026-09-10 12:00:01 +01:00
2026-09-01 20:52:44 +01:00
2026-09-02 11:16:47 +01:00
2026-07-14 12:05:06 +01:00
2026-08-03 09:53:50 +01:00
2026-09-01 20:52:44 +01:00
2019-04-02 09:44:28 +01:00
2026-07-19 20:58:20 +01:00
2026-09-02 11:16:47 +01:00
2026-09-21 22:16:06 +01:00
2026-09-21 22:16:06 +01:00
2026-09-21 22:16:06 +01:00
2026-09-03 20:12:44 +01:00
2026-07-28 08:08:26 +01:00
2026-09-21 22:16:06 +01:00
2026-09-21 22:27:43 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-09-21 22:18:44 +01:00
2026-07-21 08:00:39 +01:00
2026-07-26 10:21:01 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-02 10:26:25 +01:00
2026-07-09 09:39:44 +01:00
2026-09-21 22:27:43 +01:00
2026-07-02 10:26:25 +01:00
2026-09-08 09:36:26 +01:00
2026-09-02 11:16:47 +01:00
2026-09-02 11:16:47 +01:00
2026-09-21 22:00:47 +01:00
2026-09-01 20:52:44 +01:00
2026-07-22 20:24:21 +01:00
2026-07-23 08:06:09 +01:00
2026-09-11 11:17:35 +01:00
2026-09-10 12:00:01 +01:00
2026-08-05 08:26:10 +01:00
2026-09-09 08:53:51 +01:00
2026-09-21 22:27:43 +01:00
2026-07-26 16:08:58 +01:00
2026-07-12 23:18:47 +01:00
2026-09-09 09:32:14 +01:00
2026-09-21 22:12:33 +01:00
2026-09-01 22:07:08 +01:00
2026-09-01 20:52:44 +01:00
2026-07-28 08:08:26 +01:00
2026-09-01 20:52:44 +01:00
2026-07-23 08:06:09 +01:00
2026-09-01 22:07:08 +01:00
2026-09-01 20:52:44 +01:00
2026-09-07 13:05:38 +01:00
2026-09-07 13:05:38 +01:00
2026-09-01 20:52:44 +01:00