diff --git a/internal/cmd/root.go b/internal/cmd/root.go index c53438969d0e9f0602b763915afa4476b3a2a108..4281121e65ad1d96579ef766080c993b506a749b 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -655,11 +655,11 @@ func startDetachedServer(cmd *cobra.Command, hostURL *url.URL) error { cmdArgs = append(cmdArgs, "--host", clientHost) } - // Use exec.Command (not exec.CommandContext) so the parent's context - // cancellation does not kill the spawned server. detachProcess - // (Setsid on !windows, DETACHED_PROCESS on windows) is what truly - // detaches the child from this process's lifetime. - c := exec.Command(exe, cmdArgs...) + // Use context.Background() so the parent's context cancellation does not + // kill the spawned server. detachProcess (Setsid on !windows, + // DETACHED_PROCESS on windows) is what truly detaches the child from + // this process's lifetime. + c := exec.CommandContext(context.Background(), exe, cmdArgs...) stdoutPath := filepath.Join(chDir, "stdout.log") stderrPath := filepath.Join(chDir, "stderr.log") detachProcess(c)