fix: guard final writeHookOutput against stdout EPIPE in ponytail-activate (#149) (#152)

The final writeHookOutput('SessionStart', ...) call was the only operation
in the file outside a try/catch. writeHookOutput ends in a bare
process.stdout.write, so a closed stdout / broken pipe (EPIPE) at hook exit
throws uncaught and crashes the hook with a non-zero exit code. Wrap it to
match the file's existing never-block-session-start posture.
This commit is contained in:
Lakshya77089
2026-06-18 22:50:13 +02:00
committed by GitHub
parent a3bc7db722
commit c30854118e
+5 -1
View File
@@ -71,4 +71,8 @@ if (!isCodex) try {
// Silent fail — don't block session start over statusline detection // Silent fail — don't block session start over statusline detection
} }
writeHookOutput('SessionStart', mode, output); try {
writeHookOutput('SessionStart', mode, output);
} catch (e) {
// Silent fail — stdout closed/EPIPE at hook exit must not surface as a hook failure
}