@@ -569,7 +569,11 @@ func startDetachedServer(cmd *cobra.Command) error {
569569 cmdArgs = append(cmdArgs, "--host", clientHost)
570570 }
571571
572− c := exec.CommandContext(cmd.Context(), exe, cmdArgs...)
572+ // Use exec.Command (not exec.CommandContext) so the parent's context
573+ // cancellation does not kill the spawned server. detachProcess
574+ // (Setsid on !windows, DETACHED_PROCESS on windows) is what truly
575+ // detaches the child from this process's lifetime.
576+ c := exec.Command(exe, cmdArgs...)
573577 stdoutPath := filepath.Join(chDir, "stdout.log")
574578 stderrPath := filepath.Join(chDir, "stderr.log")
575579 detachProcess(c)