From f02fba40cd1a94b6311294268cd14be88fcd9eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Fri, 17 Jul 2026 11:50:51 +0200 Subject: [PATCH] cli: drop redundant SIGPIPE ignore in the help pager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit std.start.maybeIgnoreSigpipe() already installs a noop SIGPIPE handler at startup (std.options.keep_sigpipe defaults to false), so a write to a dead pager returns error.BrokenPipe — which the existing catch handles — instead of killing the process. The manual SIG_IGN was also the disposition std deliberately avoids, since ignored dispositions survive exec and would leak to child processes. --- src/Config.zig | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index ea33896e9..556d54850 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -784,15 +784,6 @@ fn printPaged(allocator: Allocator, text: []const u8) void { child.stderr_behavior = .Inherit; child.spawn() catch return printPlain(text); - // The pager can exit before we finish writing (e.g. `q` in less, or - // `sh -c` failing to find $PAGER); without this the resulting SIGPIPE - // would kill us. The process exits right after, so no need to restore. - std.posix.sigaction(std.posix.SIG.PIPE, &.{ - .handler = .{ .handler = std.posix.SIG.IGN }, - .mask = std.posix.sigemptyset(), - .flags = 0, - }, null); - if (child.stdin) |stdin| { var writer = stdin.writer(&.{}); // A write error here is the pager exiting early (user quit, or the