summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 01:34:23 -0300
committerGabriel Schneider <[email protected]>2026-10-30 02:10:05 -0300
commit3703c2526fb59708b00e12816bd88ffd8a15fc69 (patch)
treebfec0f20e970edf6d41a9943446dd6a52296e0db /src/pardes.zig
parent965a78eafacbffb7cd25104181c81fe5871102c1 (diff)
downloadpardes-3703c2526fb59708b00e12816bd88ffd8a15fc69.tar.gz
pardes-3703c2526fb59708b00e12816bd88ffd8a15fc69.zip
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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 081861ac..02983c84 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -67,6 +67,7 @@ pub const screen_state = if (terminal_panes) @import("screen_state.zig") else st
pub const views = @import("views.zig");
pub const rollback = @import("rollback.zig");
pub const replica = @import("replica.zig");
+pub const echo = @import("echo.zig");
pub const image = @import("image.zig");
pub const dump = @import("dump.zig");
pub const lsp = @import("lsp/lsp.zig");
@@ -478,6 +479,7 @@ pub const Loc = struct {
test {
_ = @import("rollback.zig");
_ = @import("replica.zig");
+ _ = @import("echo.zig");
_ = @import("modal.zig");
_ = @import("tagline.zig");
_ = @import("hunks.zig");
@@ -4698,6 +4700,10 @@ pub const Pardes = struct {
restore_buf: [1024]u8 = @splat(0),
surface: Surface = .{},
+ /// A replica's predicted echo (src/echo.zig), drawn over its terminals:
+ /// presentation, its own, in no digest and no rollback copy. Null on a
+ /// session's own core.
+ echo: ?*echo.Echo = null,
/// The view the fields above are of: whose layout, focus, pointer and
/// panes' cursors and scroll (views.zig). `views_open` says which views
/// there are, one a window or terminal; each not live is in `parked`.
@@ -4727,6 +4733,7 @@ pub const Pardes = struct {
"surface", "presentation", "frames", "chrome_animation", "lifts", "lift_serials",
"cursor_glide", "cursor_view", "cursor_crossing", "cursor_held", "frame_arena", "scratch",
"needs_frame", "present_skipped", "shell_continuous", "native_image_patches",
+ "echo",
// Drained by every pump before its digest; a replica's queues
// are its own.
"effects", "effects_head", "effects_len", "in_q", "in_head", "in_len",