cli: drop redundant SIGPIPE ignore in the help pager

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.
This commit is contained in:
Adrià Arrufat
2026-07-17 11:50:51 +02:00
parent d06731d8fb
commit f02fba40cd

View File

@@ -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