diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 02:11:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 3db73735e9a8d88878bc9ee343f226c033320913 (patch) | |
| tree | 93c52cd0d4d2008d765c862651464684e15006d6 /src/9p_io.zig | |
| parent | b29de1d4e78466a15f5d3dc0916410cba1445c5f (diff) | |
| download | pardes-3db73735e9a8d88878bc9ee343f226c033320913.tar.gz pardes-3db73735e9a8d88878bc9ee343f226c033320913.zip | |
A command line cut across writes runs once whole, and look/exec answer per open
A mount cuts a write at its message size, and each piece ran on its own: a
line cut at the boundary ran as shell commands and a 50 KB Edit block
broke. An open of look, exec, tagexec, any ctl or a column's exec now keeps
an unfinished last line, or an Edit block still open, until its next write
or its release, and never runs a fragment. The same open record holds what
its last write touched, which a read on it answers (as /net/tcp/clone
does); an open that never wrote reads the session's last as of its open.
A release that runs a held line waits for quiet and counts as a change;
a clicked line with a control character is still refused at its write.
Tested in unit tests, fs.py (python client, 8 KiB) and selfmount.py (the
kernel mount, a 1000-line seq burst and a 50 KB Edit block).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
| -rw-r--r-- | src/9p_io.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig index 0f5e0a77..72963e08 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -255,7 +255,7 @@ pub const Listener = struct { const refused = pardes.ctlfs.Reply.fail(req.tag, pardes.ctlfs.E.IO); return conn.reply(&refused, ""); } - if (!quiet and pardes.ctlfs.needsQuiet(req)) { + if (!quiet and pardes.ctlfs.needsQuiet(l.core, req)) { pardes.turn.parked = true; const later: pardes.ctlfs.Reply = .{ .tag = req.tag, .status = .again }; return conn.reply(&later, ""); @@ -263,6 +263,8 @@ pub const Listener = struct { const core = l.core; const epoch = pardes.turn.epoch; const restores = pardes.turn.restores; + // Asked first: a release that runs a held line has none after. + const changes = pardes.ctlfs.changesPane(core, req); const reply = core.serveFs(req); if (req.op == .release and quiet) l.collectOs(); // A read with nothing yet stays parked in the engine, and the core @@ -289,7 +291,7 @@ pub const Listener = struct { o.held = .{ .asker = conn, .req = req, .ticket = ticket }; return; } - if (!pardes.ctlfs.changesPane(req)) return conn.reply(&reply, core.fsPayload(reply)); + if (!changes) return conn.reply(&reply, core.fsPayload(reply)); // The editor draws the change and performs what it asked for; when // it asked for something -- a save, a shell, a watch -- the answer // waits until that is done, so `echo Save > exec` returns with the |
