diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 23:30:36 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | aae6fc630d9d77de9ad975414d003a55d5b9d1e3 (patch) | |
| tree | f75bad53a8538f0bff15bf9a6e58b23738f60df2 /src/ninep/tree.zig | |
| parent | d321916267fc4f0f2d82fbe1fd0d37292d24456b (diff) | |
| download | pardes-aae6fc630d9d77de9ad975414d003a55d5b9d1e3.tar.gz pardes-aae6fc630d9d77de9ad975414d003a55d5b9d1e3.zip | |
A truncating write to tag drops the one newline that ends it
`echo X > tag` stored X and a trailing newline, which drew an empty tag row.
After a truncation the newline ending each write is held back until more
text follows or the open is released, so the one ending the whole of it is
dropped and any other stays; `>>` keeps what it is given.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index ad95f6bf..e5320f61 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -676,8 +676,14 @@ fn release(p: *Pardes, req: Req) Reply { /// its releases before the connection's slot is reused, so none outlives /// the connection it came on. fn releaseHandle(p: *Pardes, req: Req) void { - const o = openOf(p, req) orelse return; const t = Node.target(req.node).?; + // A truncating write to `tag` is over when its open goes (pane.zig + // writeTag): a newline it held back is dropped. + if (t == .pane and t.pane.file == .tag) if (p.paneBySerial(t.pane.serial)) |id| { + p.panes[id].?.fs.tag_rewrite = false; + p.panes[id].?.fs.tag_held_newline = false; + }; + const o = openOf(p, req) orelse return; const of: ?*Pane = if (t == .pane) (if (p.paneBySerial(t.pane.serial)) |id| p.panes[id] else null) else null; if (of) |pn| switch (o.what) { .event => |reader| { |
