From 28c814aa5cfea23e8950ef007916ffc5d089288d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 20:09:02 -0300 Subject: Hold a read that has nothing yet and answer it when its file has news A following log, event, pty/data or a pty/run before its answer used to answer .again and wait for a wakeAll, which only the parked-write path asked for, so the band-aid had every queue push set turn.parked. Now the core keeps such a read (ctlfs.hold) and, as the turn is given up after anything that queued a record, ran a command out or closed a pane, answers it on its own connection, the way factotum answers the log reads it keeps and acme an event read. Only a read the engine still holds parked is answered, because cloud9 tells the backend nothing of a Tflush, so a flushed read spends no record. Co-Authored-By: Claude Opus 5.5 --- src/fs.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/fs.zig') diff --git a/src/fs.zig b/src/fs.zig index 8e2c52a1..50a446dc 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -1243,6 +1243,12 @@ pub const Namespace = struct { panes: [MAX_PANES]tree.pane.State = @splat(.{}), listeners: u16 = 0, origin: u8 = 'K', + /// Reads that found nothing yet, one per open that can wait: the log's + /// and a run's opens, and one event and one pty/data reader a pane. + held: [tree.screen.snapshot_slots + tree.pty.run_slots + 2 * MAX_PANES]?tree.Held = @splat(null), + /// Something a held read may be waiting on changed since they were last + /// answered: a record queued, a run answered, a pane gone. + news: bool = false, /// The editor-wide event ring: panes made, renamed, saved and closed, and /// what the editor said. Recorded whether or not anyone reads /log. log: tree.events.Queue = .{ .cap = limits.log_bytes }, -- cgit v1.3