From 79311cd89746738a20be359c054dc2a7c84577db Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:19:33 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/host_io.zig | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/host_io.zig') 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, ); -- cgit v1.3