github.com/symfony-cli/symfony-cli@v0.0.0-20240514161054-ece2df437dfa/local/runner_posix.go (about)

     1  //go:build !windows
     2  // +build !windows
     3  
     4  package local
     5  
     6  import (
     7  	"os/exec"
     8  	"syscall"
     9  )
    10  
    11  func buildCmd(cmd *exec.Cmd, foreground bool) error {
    12  	cmd.SysProcAttr = &syscall.SysProcAttr{
    13  		// isolate each command in a new process group that we can cleanly send
    14  		// signal to when we want to stop it
    15  		Setpgid:    true,
    16  		Foreground: foreground,
    17  	}
    18  
    19  	return nil
    20  }