On Windows, Claude Code runs the UserPromptSubmit hook through a PowerShell
if {} wrapper that can swallow the piped prompt JSON, so stdin 'end' never
fires and ponytail-mode-tracker.js blocks forever, freezing the session.
Make the hook non-blocking: extract the handler into finish() guarded by a
done flag, and add a 1s unref()'d fallback timeout plus the existing stdin
error handler that both call finish() then exit 0. unref() means zero added
latency on the normal path where 'end' fires first. Adds a regression test
that spawns the hook with a never-closing stdin pipe and asserts self-exit.
Reconciles #453 onto main after #227 (stdin error handler) and #474 (exec
node hooks) landed.
Closes #443
Co-authored-by: Hasnan42 <154899774+Hasnan42@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| behavior.test.js | ||
| commands.test.js | ||
| copilot-plugin.test.js | ||
| correctness.test.js | ||
| gemini-extension.test.js | ||
| hermes-plugin.test.js | ||
| hooks-windows.test.js | ||
| hooks.test.js | ||
| openclaw-skills.test.js | ||
| opencode-plugin.test.js | ||
| uninstall.test.js | ||