terminal_unix.go
1//go:build unix
2
3package terminal
4
5import "syscall"
6
7// sysProcAttr returns the syscall.SysProcAttr for Unix systems.
8// It creates a new session and sets the controlling terminal to isolate
9// the subprocess from the parent terminal.
10func sysProcAttr() *syscall.SysProcAttr {
11 return &syscall.SysProcAttr{
12 Setsid: true,
13 Setctty: true,
14 }
15}