summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 20:20:27 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit7dc3891ed574d6e96548f592b09b0f8abc87ae2a (patch)
tree70cddb9ce4a7e9039f8167e806b7e996f94eefb0 /src/ninep/pane.zig
parentacd9e032a147f4aa7ad49110dc2f4fb945e7a9bb (diff)
downloadpardes-7dc3891ed574d6e96548f592b09b0f8abc87ae2a.tar.gz
pardes-7dc3891ed574d6e96548f592b09b0f8abc87ae2a.zip
Keep what each open holds in one table of open records
Snapshots (and /log's cursor), runs, and the reader_handle constants for event and pty/data each reused the open handle and each validated handle and node on its own. Now p.fs.opens is one table of 64 records, each the node it was opened on and a tagged union of what it holds, like lib9p's per-fid aux and acme's Fid (editors/acme/dat.h:373-385): one lookup (openOf), one release, ENFILE when full. A held read lives in its open's record, so it goes with the release. Opens that hold nothing answer handle 0 and take no record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index b07ee038..c03cd776 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -32,6 +32,7 @@ pub const State = struct {
/// `cat addr` answer what was written.
addr: Range = .{},
limit: ?Range = null,
+ /// Opens of `event`, which hold the pane scripted.
readers: u16 = 0,
/// One of `readers` reads `event`; a second reading open is refused.
event_reader: bool = false,
@@ -39,9 +40,11 @@ pub const State = struct {
nomark: bool = false,
noscroll: bool = false,
tag_snap: std.ArrayList(u8) = .empty,
- pty_readers: u16 = 0,
+ /// An open reads pty/data, so output queues for it; a second is refused.
+ pty_reader: bool = false,
pty_out: events.Queue = .{},
- /// The pty/run open waiting on this shell's current command.
+ /// The open record (tree.zig) of the pty/run waiting on this shell's
+ /// current command.
run: ?u8 = null,
/// The host started a shell it could not teach to mark its prompts.
unmarked: bool = false,