From 0763a35fbc60d6209209a5545ab64e1631f43d48 Mon Sep 17 00:00:00 2001 From: Hwanseo Choi Date: Sat, 7 Mar 2026 19:20:17 +0900 Subject: [PATCH] Fix `bun run dev:desktop` from not terminating properly on SIGINT/SIGTERM/SIGHUP (#305) * fix: handle turbo shutdown in dev runner * refactor: rely on effect child process shutdown * refactor: inline turbo shutdown timeout * add back sigint sigterm sighup handling * refactor: tighten turbo signal forwarding * refactor: inline dev runner errors * fix: use detached false instead of manual signal forwarding Effect defaults to detached: true on non-Windows, putting turbo in a new process group where terminal signals (Ctrl+C) never reach it. Setting detached: false keeps turbo in the same group, eliminating the need for ~130 lines of manual signal forwarding. * Update scripts/dev-runner.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/dev-runner.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/dev-runner.ts b/scripts/dev-runner.ts index faab7d4ae1ee9c94d2b4a755601b64bf1833d653..c72411e318bd8ddc807792548a68da4dfdd6bfc7 100644 --- a/scripts/dev-runner.ts +++ b/scripts/dev-runner.ts @@ -455,6 +455,11 @@ export function runDevRunnerWithInput(input: DevRunnerCliInput) { stderr: "inherit", env, extendEnv: false, + // Keep turbo in the same process group so terminal signals (Ctrl+C) + // reach it directly. Effect defaults to detached: true on non-Windows, + // which would put turbo in a new group and require manual forwarding. + detached: false, + forceKillAfter: "1500 millis", }, ); -- 2.54.0