summaryrefslogtreecommitdiff
path: root/src/host_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:19:33 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:00:58 -0300
commit79311cd89746738a20be359c054dc2a7c84577db (patch)
treebf47d14365eb8886e75a5e693702672dd3b1ffc2 /src/host_io.zig
parent86b873a851820485c5720463195ff98466ddc315 (diff)
downloadpardes-79311cd89746738a20be359c054dc2a7c84577db.tar.gz
pardes-79311cd89746738a20be359c054dc2a7c84577db.zip
9p_io: exportPaneEnv and exportSessionEnv are one exportEnv, telling a child this process's own socket, which a listener's path is from its listen to its deinit; host_io's two calls name it, and forkShell's listener argument, read by nothing now, goes from the frontends' calls with them; the env test sets the socket rather than building a Listener
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/host_io.zig')
-rw-r--r--src/host_io.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/host_io.zig b/src/host_io.zig
index 8db03f95..97e6cbbc 100644
--- a/src/host_io.zig
+++ b/src/host_io.zig
@@ -1705,7 +1705,7 @@ pub const ChildEnv = struct {
"TERM_PROGRAM=" ++ pardes.config.child_term_program,
};
- /// What this editor tells its children of itself (exportPaneEnv, `$winid`),
+ /// What this editor tells its children of itself (exportEnv, `$winid`),
/// kept here rather than set into this process's environment: std's Io read
/// that block at startup, and setenv/unsetenv rewrite it in place under it
/// (a spawn then scans a null inside it). `build` puts each exported one in
@@ -1945,11 +1945,11 @@ pub fn testUnsetenv(name: [*:0]const u8) c_int {
return unsetenv(name);
}
-/// The environment a pane's command is given (exportPaneEnv, `$winid`,
+/// The environment a pane's command is given (exportEnv, `$winid`,
/// ChildEnv), as `NAME=value` lines in `arena`, for a command that is not a
/// pane's: an Edit's filters, run from pane `serial`.
pub fn commandEnv(arena: std.mem.Allocator, serial: u32, adopts: bool) ![]const []const u8 {
- ninep_io.exportSessionEnv(serial, adopts);
+ ninep_io.exportEnv(serial, adopts);
exportWinid(serial);
var slots: ChildEnv.Slots = undefined;
const envp = ChildEnv.build(&slots, .command) orelse return error.EnvironmentTooLarge;
@@ -2030,8 +2030,10 @@ pub fn forkShell(
// The last argument is whether this session takes its children's Looks —
// every session does but a `--nested` one, and a fork with no core at all
// (the tests below) is nobody's parent.
- ninep_io.exportPaneEnv(
- fs,
+ // shortcut: `fs` is read by nothing now (exportEnv takes this process's
+ // own socket); its argument goes from the frontends' calls with them.
+ _ = fs;
+ ninep_io.exportEnv(
if (core) |c| (if (c.panes[pane]) |pn| pn.serial else 0) else 0,
if (core) |c| !c.opts.nested else false,
);