()
| 10 | |
| 11 | // Prevents memory leak when pipe is broken (e.g., `claude -p | head -1`) |
| 12 | export function registerProcessOutputErrorHandlers(): void { |
| 13 | process.stdout.on('error', handleEPIPE(process.stdout)) |
| 14 | process.stderr.on('error', handleEPIPE(process.stderr)) |
| 15 | } |
| 16 | |
| 17 | function writeOut(stream: NodeJS.WriteStream, data: string): void { |
| 18 | if (stream.destroyed) { |
no test coverage detected