From 3703c2526fb59708b00e12816bd88ffd8a15fc69 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 01:34:23 -0300 Subject: echo: a replica draws a key typed into a terminal at once, mosh's way (a printable character at the cursor, Backspace, Left and Right, in tty mode on the primary screen), from an overlay of its own that no digest, dump or rollback copy sees, painted over the terminal's body at the end of renderBody (the tty's and the GUI's); judged at each delta once the authority has the key and 50 ms have passed, every prediction taken back on a mismatch; drawn at once at a prompt pardes's marks vouch for, elsewhere only once an echo was confirmed, never after a drawn misprediction until one is, so a password prompt or a program that ignores input shows nothing typed; the keys typed behind one not predicted (Tab, Enter) predicted over the screen that shows its doing; zig build replicas -- --echo types a corpus into a played shell at 30/80/207 ms: a key to its character p50 239 -> 8.9 ms and p90 248 -> 15.8 ms at 207, no wrong character drawn; docs/next-daemon.md: the decisions, the hook for the remote client, the numbers, the gates and what is not done Co-Authored-By: Claude Opus 5.5 --- src/rollback.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/rollback.zig') diff --git a/src/rollback.zig b/src/rollback.zig index 37fc481d..6496a69f 100644 --- a/src/rollback.zig +++ b/src/rollback.zig @@ -415,10 +415,11 @@ fn annotatedStruct(comptime T: type) bool { /// is taken: what is in their slots is nothing), the frame statistics /// (numbers, and a static name), and the rows a terminal was last read as /// (a grid's worth of text, emptied when a copy is taken and when it is -/// put back: src/replica.zig). +/// put back: src/replica.zig), and a replica's predicted echo (src/echo.zig: +/// the replica's, never its core's). fn unsaved(comptime name: []const u8) bool { return std.mem.eql(u8, name, "effects") or std.mem.eql(u8, name, "in_q") or std.mem.eql(u8, name, "frames") or - std.mem.eql(u8, name, "shell_rows"); + std.mem.eql(u8, name, "shell_rows") or std.mem.eql(u8, name, "echo"); } fn annotated(comptime T: type, comptime kind: []const u8, comptime name: []const u8) bool { -- cgit v1.3