summaryrefslogtreecommitdiff
path: root/core/Effect.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 16:50:34 -0300
committerGabriel Schneider <[email protected]>2026-11-22 16:53:19 -0300
commit9863a63b614d200852853825031189364dcacfdc (patch)
treed235648a2ac14b3e311746ced3433ed6865e2061 /core/Effect.zig
parent6544f73a6b50e5ba68564beea7784593bb54348e (diff)
parentbad506bd45846e012246a33b5d3097b3e92f02bc (diff)
downloadpardes-9863a63b614d200852853825031189364dcacfdc.tar.gz
pardes-9863a63b614d200852853825031189364dcacfdc.zip
integration: the old road deleted and the emulator's boundary on the gathered line: pardes-merge56 (`qvwrwxtu`: the installed tree and the source view's changes to their last slice) and pardes-term-join-9 (`twssqzqw`, fourteen changes on pardes-merge55: every client's terminals by the pty's bytes and nothing else: the delta protocol, its flow control and core/term/screen_state.zig deleted (-3,605 +504 lines), the wire at 30, one soak; S1: abi/term.zig's Ops in replicated and local, the terminal's digest covering what a step reads, every call of the core's into a terminal listed with its rule as a test; a client's own join again judged after its goodbye; a pty's size one fact the core hands its host for every fork, adopt and resize; a closed view sizes no terminal); no textual conflict; one semantic one, resolved here: core/jj.zig's Churn test (the layers' last round) called Authority.init and Replica.init with the road's flag the deletion took away: the argument removed; core-test 916/1073 (157 skipped), shell-test 1115/1118; its gate: .scratch/sketch/reorg/merge57, the numbers in PARDES.md (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Effect.zig')
-rw-r--r--core/Effect.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/Effect.zig b/core/Effect.zig
index cabfe8ea..abfe4711 100644
--- a/core/Effect.zig
+++ b/core/Effect.zig
@@ -22,6 +22,10 @@ const Host = pardes.Host;
/// to the shell itself when the shell is in the foreground.
pub const PtySignal = enum(u8) { int, term, hup, quit, kill };
+/// A pty's size as the core gives it to its host: in cells, and in pixels
+/// at the cell of the view that sizes its pane (Core.ptySize).
+pub const PtySize = struct { cols: u16, rows: u16, w_px: u16 = 0, h_px: u16 = 0 };
+
/// IO the core wants done. Payloads are inline (fixed buffers): effects are
/// queued values with no lifetime ties back into the core.
pub const WatchMode = enum { reconcile, baseline_disk };
@@ -118,14 +122,15 @@ fn performInner(p: *Pardes, e: Effect) void {
defer panes.File.syncTwins(p);
switch (e) {
// The host reads the pane (its command, its shell) as it forks,
- // so the slot must still hold the pane the spawn was for.
- .spawn => |s| if (if (p.panes[s.pane.index()]) |pane| pane.serial != s.serial else true) {} else p.tape.host(p, .spawn, .{ s.pane, if (s.cwd.len == 0) (p.spawn_dirs[s.pane.index()] orelse "") else s.cwd.slice() }) orelse {
+ // so the slot must still hold the pane the spawn was for. It forks
+ // at the pane's grid: laid out by the step that asked (`sync`).
+ .spawn => |s| if (if (p.panes[s.pane.index()]) |pane| pane.serial != s.serial else true) {} else p.tape.host(p, .spawn, .{ s.pane, if (s.cwd.len == 0) (p.spawn_dirs[s.pane.index()] orelse "") else s.cwd.slice(), p.ptySize(s.pane, null) }) orelse {
p.fallback.spawned[s.pane.index()] = true;
},
// A pane with no child is silent: nothing invents output on its
// screen, and the bytes are dropped rather than transcribed.
.write => |w| _ = p.tape.host(p, .pty_write, .{ w.pane, w.bytes.slice() }),
- .resize_pty => |r| _ = p.tape.host(p, .pty_resize, .{ r.pane, r.cols, r.rows }),
+ .resize_pty => |r| _ = p.tape.host(p, .pty_resize, .{ r.pane, p.ptySize(r.pane, .{ r.cols, r.rows }) }),
// A signal for a pane that closed, its slot retaken in the same
// step, would reach another pane's child.
.signal_pty => |s| if (if (p.panes[s.pane.index()]) |pane| pane.serial != s.serial else true) {} else p.tape.host(p, .pty_signal, .{ s.pane, s.sig }) orelse {},