summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 15:47:52 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitc2e58c827bd8d2497c86b2eca23ac096cb972296 (patch)
treeb9e46bee4978e97952d377b6e21f20338dc08d2c /src/ninep/pane.zig
parent9babe3a63ca06b4b0248d1d21ccb74687c5b188d (diff)
downloadpardes-c2e58c827bd8d2497c86b2eca23ac096cb972296.tar.gz
pardes-c2e58c827bd8d2497c86b2eca23ac096cb972296.zip
A ctl or exec line with no newline runs with its write and fails it, unless it needs more
A last line with no newline was held to the close, so printf bogus > ctl answered 0 and failed only in the log, Edit ,s/zzz/y/ too. A write shorter than its Twrite is the whole of what was written (acme takes each write whole): its tail runs then and a failure is the write's. It is held only when the parser says it needs more -- an open { block, an a/c/i text -- or when the write filled its Twrite and may go on (the listener tells the core the room, msize less its header). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 9f85a75f..d760bebd 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -1153,13 +1153,19 @@ test "a name cut across writes is one name, applied once at its newline or its c
const node = Node.of(serial, .name);
const h = call(p, .{ .tag = 1, .op = .open, .node = node, .omode = 1 }).reply.handle;
try testing.expect(h != 0);
+ // A piece that fills its Twrite goes on in the next.
+ p.fs.write_room = "/tmp/pardes-na".len;
_ = call(p, .{ .tag = 2, .op = .write, .node = node, .handle = h, .data = "/tmp/pardes-na" });
+ p.fs.write_room = 0;
try testing.expectEqualStrings("/test.txt", nameOf(p.panes[p.paneBySerial(serial).?].?));
_ = call(p, .{ .tag = 2, .op = .write, .node = node, .handle = h, .data = "me.txt\n" });
try testing.expectEqualStrings("/tmp/pardes-name.txt", nameOf(p.panes[p.paneBySerial(serial).?].?));
- // No newline: the close applies it.
- _ = call(p, .{ .tag = 2, .op = .write, .node = node, .handle = h, .data = "/tmp/pardes-closed.txt" });
_ = call(p, .{ .tag = 3, .op = .release, .node = node, .handle = h, .opened = true });
+ // No newline, the whole write: applied at once, on its own open.
+ const h3 = call(p, .{ .tag = 1, .op = .open, .node = node, .omode = 1 }).reply.handle;
+ _ = call(p, .{ .tag = 2, .op = .write, .node = node, .handle = h3, .data = "/tmp/pardes-closed.txt" });
+ try testing.expectEqualStrings("/tmp/pardes-closed.txt", nameOf(p.panes[p.paneBySerial(serial).?].?));
+ _ = call(p, .{ .tag = 3, .op = .release, .node = node, .handle = h3, .opened = true });
try testing.expectEqualStrings("/tmp/pardes-closed.txt", nameOf(p.panes[p.paneBySerial(serial).?].?));
}