Documentation
¶
Index ¶
- func ApplyToProcess() error
- func CombinedOutputShellCommand(cmd *exec.Cmd) ([]byte, error)
- func ConfigureShellCommand(cmd *exec.Cmd)
- func LoginShell() string
- func OutputShellCommand(cmd *exec.Cmd) ([]byte, error)
- func Resolve() ([]string, error)
- func RunShellCommand(cmd *exec.Cmd) error
- func SetProcessRecordDir(string) func()
- func StartShellCommand(cmd *exec.Cmd) error
- func SupportsInteractive(shell string) bool
- func TerminateShellCommandGroup(cmd *exec.Cmd)
- func WellKnownBinDirs() []string
- func WellKnownBinDirsForHome(home string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyToProcess ¶
func ApplyToProcess() error
func CombinedOutputShellCommand ¶
CombinedOutputShellCommand is the process-tree-cleaning counterpart to cmd.CombinedOutput. It requires cmd.Stdout and cmd.Stderr to be unset, captures both streams, and delegates lifecycle cleanup to RunShellCommand.
func ConfigureShellCommand ¶
ConfigureShellCommand is a no-op on platforms that lack process groups (and a process-tree kill primitive). Context cancellation falls back to the exec.CommandContext default of terminating the direct child only.
func LoginShell ¶
func LoginShell() string
func OutputShellCommand ¶
OutputShellCommand is the process-tree-cleaning counterpart to cmd.Output. It requires cmd.Stdout to be unset, captures stdout, and delegates lifecycle cleanup to RunShellCommand.
func RunShellCommand ¶
RunShellCommand starts cmd with StartShellCommand, waits for it, and terminates any surviving command-group descendants.
Use this instead of cmd.Run after ConfigureShellCommand so clean exits and ordinary errors get the same process-tree cleanup as context cancellation.
func SetProcessRecordDir ¶
func SetProcessRecordDir(string) func()
SetProcessRecordDir is a no-op outside unix.
Windows commands are confined to a kill-on-close job object (see ConfigureShellCommand in shell_command_windows.go). The kernel tears the whole job down when the handle closes, including on abrupt process death, so there is no escaped-descendant class for a persisted record to recover.
func StartShellCommand ¶
StartShellCommand starts cmd on platforms without extra process-tree setup. It exists so call sites can use the same lifecycle helpers on every platform.
func SupportsInteractive ¶
func TerminateShellCommandGroup ¶
TerminateShellCommandGroup is a no-op on platforms without a process-tree kill primitive, mirroring ConfigureShellCommand. The reap-the-group-on-exit guarantee is best-effort and platform-gated.
func WellKnownBinDirs ¶
func WellKnownBinDirs() []string
WellKnownBinDirs returns common binary install locations that should be on PATH for tools like Homebrew, user-local installs, and language package managers (Go, Rust). Non-existent directories are included unchanged because Go's exec.LookPath ignores missing PATH entries - filtering here would require filesystem access in resolution, which complicates testing without adding value for daemon launch.
func WellKnownBinDirsForHome ¶
Types ¶
This section is empty.