summaryrefslogtreecommitdiff
path: root/src/Effect.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:51:15 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit79a1e816ceb13ef81b712007716c8add2de75434 (patch)
tree1714b1bf19da3a58be2623ffe29e3f8be1b21fe3 /src/Effect.zig
parenta22b579ad2df8d1811f0e194fa1bbc06e2282cf8 (diff)
parentf1af015f01e4e8d42f6224c4d4063f3aea218f5a (diff)
downloadpardes-79a1e816ceb13ef81b712007716c8add2de75434.tar.gz
pardes-79a1e816ceb13ef81b712007716c8add2de75434.zip
integration: the terminal a module of its own, with the plumber whole and the walker's cheaper compile
A merge of term-phase1a and pardes-next, no conflicts. core-test (the core with no terminal) 411 passed, 535 skipped of 946; shell-test (the same tests, the terminal compiled in) 989/989, on tui. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/Effect.zig')
-rw-r--r--src/Effect.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Effect.zig b/src/Effect.zig
index e161d1db..7f0c3fdf 100644
--- a/src/Effect.zig
+++ b/src/Effect.zig
@@ -46,6 +46,10 @@ pub const Effect = union(enum) {
/// and ends the shell, rather than leave it running with nobody to read.
close_pty: struct { pane: u8 },
open_link: Buf(256),
+ /// A program a plumbing rule starts (Plumb.run): its directory, then
+ /// its argv, each ended by a NUL. A failure to start it is said at
+ /// pane `pane`.
+ start: struct { pane: u8, line: Buf(effect_path_cap) },
/// write this pane's file content to its path; the shell reads both off
/// the core (content is unbounded, effects are fixed-size values)
save_file: struct { pane: u8 },
@@ -132,6 +136,18 @@ pub fn perform(p: *Pardes, e: Effect) void {
f(p.host.ctx, u.slice())
else
p.fallback.setLink(u.slice()),
+ // Plan 9's plumber's, detached (host_io.startDetached); in-process
+ // (a test), kept to look at.
+ .start => |st| {
+ var why_buf: [64]u8 = undefined;
+ const why = if (v.start) |f| f(p.host.ctx, st.line.slice(), &why_buf) else p.fallback.start(st.line.slice());
+ const w = why orelse return;
+ var words = std.mem.splitScalar(u8, st.line.slice(), 0);
+ _ = words.next(); // its directory
+ const prog = words.next() orelse "";
+ var said: pardes.Kind.Buf(160) = .{};
+ p.reportFailure(st.pane, said.print("plumb start: {s}: {s}", .{ prog[0..@min(64, prog.len)], w }));
+ },
.save_file => |sf| {
const pane = p.panes[sf.pane] orelse return;
const f = if (pane.file) |*file| file else return;