@@ -655,11 +655,11 @@ func startDetachedServer(cmd *cobra.Command, hostURL *url.URL) error {
655655 cmdArgs = append(cmdArgs, "--host", clientHost)
656656 }
657657
658− // Use exec.Command (not exec.CommandContext) so the parent's context
659− // cancellation does not kill the spawned server. detachProcess
660− // (Setsid on !windows, DETACHED_PROCESS on windows) is what truly
661− // detaches the child from this process's lifetime.
662− c := exec.Command(exe, cmdArgs...)
658+ // Use context.Background() so the parent's context cancellation does not
659+ // kill the spawned server. detachProcess (Setsid on !windows,
660+ // DETACHED_PROCESS on windows) is what truly detaches the child from
661+ // this process's lifetime.
662+ c := exec.CommandContext(context.Background(), exe, cmdArgs...)
663663 stdoutPath := filepath.Join(chDir, "stdout.log")
664664 stderrPath := filepath.Join(chDir, "stderr.log")
665665 detachProcess(c)