github.com/nektos/act@v0.2.63-0.20240520024548-8acde99bfa9c/pkg/container/util.go (about)

     1  //go:build (!windows && !plan9 && !openbsd) || (!windows && !plan9 && !mips64)
     2  
     3  package container
     4  
     5  import (
     6  	"os"
     7  	"syscall"
     8  
     9  	"github.com/creack/pty"
    10  )
    11  
    12  func getSysProcAttr(_ string, tty bool) *syscall.SysProcAttr {
    13  	if tty {
    14  		return &syscall.SysProcAttr{
    15  			Setsid:  true,
    16  			Setctty: true,
    17  		}
    18  	}
    19  	return &syscall.SysProcAttr{
    20  		Setpgid: true,
    21  	}
    22  }
    23  
    24  func openPty() (*os.File, *os.File, error) {
    25  	return pty.Open()
    26  }