mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-23 00:54:43 +00:00
fix(core): handle SIGHUP and kill process (#16057)
This commit is contained in:
@@ -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))
|
let cli = yargs(hideBin(process.argv))
|
||||||
.parserConfiguration({ "populate--": true })
|
.parserConfiguration({ "populate--": true })
|
||||||
.scriptName("opencode")
|
.scriptName("opencode")
|
||||||
|
|||||||
Reference in New Issue
Block a user