mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 09:11:42 +00:00
fix(core): handle SIGHUP and kill process (#16057)
This commit is contained in:
parent
218330aec1
commit
45ac20b8aa
1 changed files with 5 additions and 0 deletions
|
|
@ -46,6 +46,11 @@ process.on("uncaughtException", (e) => {
|
|||
})
|
||||
})
|
||||
|
||||
// Ensure the process exits on terminal hangup (eg. closing the terminal tab).
|
||||
// Without this, long-running commands like `serve` block on a never-resolving
|
||||
// promise and survive as orphaned processes.
|
||||
process.on("SIGHUP", () => process.exit())
|
||||
|
||||
let cli = yargs(hideBin(process.argv))
|
||||
.parserConfiguration({ "populate--": true })
|
||||
.scriptName("opencode")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue