From 67986adffc93b960ec661bd239d68baa67c6b684 Mon Sep 17 00:00:00 2001 From: "jin.2" Date: Sat, 14 Mar 2026 20:33:20 +0900 Subject: [PATCH] fix: correct misleading SIGPIPE comment (#776) The comment said "Ignore SIGPIPE" but the code actually resets SIGPIPE to SIG_DFL (default behavior = process termination), not SIG_IGN (ignore). Updated the comment to accurately describe what the code does and why. Co-authored-by: hyunjinee Co-authored-by: Claude Opus 4.6 (1M context) --- cli/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index d9d781c..bb1b57e 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -164,7 +164,8 @@ fn run_session(args: &[String], session: &str, json_mode: bool) { } fn main() { - // Ignore SIGPIPE to prevent panic when piping to head/tail + // Rust ignores SIGPIPE by default, causing println! to panic on broken pipes. + // Reset to SIG_DFL so the OS terminates the process cleanly instead. #[cfg(unix)] unsafe { libc::signal(libc::SIGPIPE, libc::SIG_DFL);