Files
2026-07-13 13:00:08 +08:00

21 lines
413 B
Go

//go:build !windows
package control
import (
"os/exec"
"testing"
)
func TestSetShellKillTreeDetachesControllingTerminal(t *testing.T) {
cmd := exec.Command("sh", "-c", "true")
setShellKillTree(cmd)
if cmd.SysProcAttr == nil {
t.Fatal("SysProcAttr is nil")
}
if !cmd.SysProcAttr.Setsid {
t.Fatal("shell commands should run in a new session so interactive prompts cannot grab the TUI terminal")
}
}