From 76ac996933d356b44458afc0aee76c758aeb4b26 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 9 Nov 2026 04:08:35 -0300 Subject: soak: a tty replica client draws its own motions (the glide, a jump's trail) a frame a tick while they move, as the local loop's waitInput does: its loop woke only for an event, so a wheel's glide showed nothing until the next key (instant's tty scroll_wheel 56% at once, p99 624 ms, through the box and at 0 ms alike) Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/tui/tui.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tui/tui.zig b/src/tui/tui.zig index af274b3f..df51960e 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -759,6 +759,15 @@ pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, se // Its predicted echo judged and caught up, once a frame. if (r.echoFrame()) link.dirty = true; if (link.dirty) remote_link.draw(&sh); + // The tty's own motions (its glide, a jump's trail) drawn a frame + // a tick while they move, as waitInput wakes the local loop: a + // wheel's glide was drawn only at the next event. After the + // draw, which starts a glide, and after the last iteration's + // wakes, as the latest asked for is the one kept. + if (sh.moving()) { + link.dirty = true; + requestWake(io, @intCast(pardes.frame_ns / std.time.ns_per_ms)); + } const first = (loop.tryEvent() catch null) orelse idle: { // Idle, its frame drawn: the next key needs no copy taken. r.ready(); -- cgit v1.3