Skip to content

fix(core): restore SIGHUP exit handler (#16057)#18527

Open
thdxr wants to merge 2 commits intodevfrom
restore-sighup-handler
Open

fix(core): restore SIGHUP exit handler (#16057)#18527
thdxr wants to merge 2 commits intodevfrom
restore-sighup-handler

Conversation

@thdxr
Copy link
Member

@thdxr thdxr commented Mar 21, 2026

Summary

This restores the SIGHUP handler that was previously reverted in commit a73ac65. The handler ensures the process exits on terminal hangup (eg. closing the terminal tab), preventing long-running commands like serve from becoming orphaned processes.

Changes

  • Added process.on("SIGHUP", () => process.exit()) to packages/opencode/src/index.ts

Why this matters

Without this handler, long-running commands like serve can block on a never-resolving promise and survive as orphaned processes after the terminal closes.

This restores the SIGHUP handler that was previously reverted. The handler ensures the process exits on terminal hangup (eg. closing the terminal tab), preventing long-running commands like `serve` from becoming orphaned processes.
@thdxr thdxr added the beta label Mar 21, 2026
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants