From 5569be61a74dfe2c9d16805a133b84b8b1505ca7 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 11 May 2026 21:07:49 -0400 Subject: [PATCH] fix(lint): require `exec.CommanadContext` over `exec.Command` --- internal/cmd/root.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)