summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 13:39:12 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit164da9fc0a7ab3c7ed39ea0a2dd6bbff3c36cdaf (patch)
treebba5867e52764c5d2f891b8e6861dfdeec068063 /src/linux
parentfea3f2c5abf14aada5d9187b82985e51eb5b7a98 (diff)
downloadpardes-164da9fc0a7ab3c7ed39ea0a2dd6bbff3c36cdaf.tar.gz
pardes-164da9fc0a7ab3c7ed39ea0a2dd6bbff3c36cdaf.zip
Every child starts with its signals at their defaults and none blocked
Shells, command panes, language servers, the link opener and the v9fs mount inherited the editor's signal mask (the tty's blocked SIGWINCH) and anything it ignored (a SIGHUP nohup ignored), since only handlers reset at exec. Each fork now resets every disposition and clears the mask before its exec (resetChildSignals); std's spawn for selection pipes runs with the mask cleared across it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/v9fs.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/linux/v9fs.zig b/src/linux/v9fs.zig
index 4e18660d..5e031bfe 100644
--- a/src/linux/v9fs.zig
+++ b/src/linux/v9fs.zig
@@ -118,6 +118,16 @@ fn launch(arena: std.mem.Allocator, args: []const [:0]const u8) !u8 {
const pid = fork();
if (pid < 0) return error.ForkFailed;
if (pid == 0) {
+ // host_io's resetChildSignals, here in its own module: every signal
+ // back to its default and none blocked before the exec.
+ const default: std.posix.Sigaction = .{ .handler = .{ .handler = std.posix.SIG.DFL }, .mask = std.posix.sigemptyset(), .flags = 0 };
+ var sig: u8 = 1;
+ while (sig < 65) : (sig += 1) {
+ if (sig == @intFromEnum(std.posix.SIG.KILL) or sig == @intFromEnum(std.posix.SIG.STOP)) continue;
+ _ = std.c.sigaction(@enumFromInt(sig), &default, null);
+ }
+ const none = std.posix.sigemptyset();
+ std.posix.sigprocmask(std.posix.SIG.SETMASK, &none, null);
_ = execvp("sudo", argv.ptr);
_exit(127);
}