summaryrefslogtreecommitdiff
path: root/src/ninep/tree.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 04:55:00 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit253a5c1e036d96eada910c47eb500ed0c8e37b5c (patch)
tree88366de4f3e17029a61b94ddb37e80795a9849fb /src/ninep/tree.zig
parentcdf4cbbf1fdd121aabdbbea33f11d5ee44d7764e (diff)
downloadpardes-253a5c1e036d96eada910c47eb500ed0c8e37b5c.tar.gz
pardes-253a5c1e036d96eada910c47eb500ed0c8e37b5c.zip
A pane has a tagexec: a word run as a click in its tag
The workspace had /tagexec and a column its exec, but a pane's own tag could be clicked only by an event record. pane/<n>/tagexec runs each line as a click in that pane's tag (never redirected to its event reader, as a header's is not) and reads back what it touched. The README, fs.md and the skill list it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
-rw-r--r--src/ninep/tree.zig13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index f45a1a90..398824d5 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -259,6 +259,9 @@ pub const PaneFile = enum(u5) {
event,
look,
exec,
+ /// A word run as a click in the pane's tag, as /tagexec is in the
+ /// workspace's and col/<n>/exec in a column's.
+ tagexec,
pty,
pty_ctl,
pty_status,
@@ -965,7 +968,7 @@ fn linesFile(target: Target) bool {
return switch (target) {
.top => |f| f == .look or f == .exec or f == .ctl or f == .tagexec,
.col => |c| c.file == .ctl or c.file == .exec,
- .pane => |t| t.file == .look or t.file == .exec or t.file == .ctl,
+ .pane => |t| t.file == .look or t.file == .exec or t.file == .ctl or t.file == .tagexec,
};
}
@@ -974,7 +977,7 @@ fn resultsFile(target: Target) bool {
return switch (target) {
.top => |f| f == .look or f == .exec or f == .tagexec,
.col => |c| c.file == .exec,
- .pane => |t| t.file == .look or t.file == .exec,
+ .pane => |t| t.file == .look or t.file == .exec or t.file == .tagexec,
};
}
@@ -1025,7 +1028,7 @@ fn write(p: *Pardes, req: Req, target: Target) Reply {
fn writeNow(p: *Pardes, req: Req, target: Target) Reply {
switch (target) {
.top => |f| return switch (f) {
- .look, .exec => ctl.command(p, req, null, f == .exec),
+ .look, .exec => ctl.command(p, req, null, f == .exec, false),
.log => events.writeLog(p, req),
.focus => ctl.writeFocus(p, req),
.ctl => ctl.writeRoot(p, req),
@@ -1234,10 +1237,10 @@ test "readdir lists the root and a pane directory without creating anything" {
const dir = rdir(p, Node.of(serial, .dir), 0);
const files = th.dirents(dir.bytes, &buf);
- try testing.expectEqual(@as(usize, 17), files.len);
+ try testing.expectEqual(@as(usize, 18), files.len);
for ([_][]const u8{
"name", "body", "tag", "ctl", "addr", "dot", "limit", "data", "xdata",
- "sel", "dirty", "mark", "scroll", "errors", "event", "look", "exec",
+ "sel", "dirty", "mark", "scroll", "errors", "event", "look", "exec", "tagexec",
}, 0..) |name, i|
try testing.expectEqualStrings(name, files[i].name);
try testing.expect(th.nameAt(files, ".") == null);