platform

package
v0.3.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package platform contains the small amount of process behaviour that is inherently operating-system specific. Keeping it outside the session package makes the PTY lifecycle compile cleanly on unsupported platforms.

Index

Constants

This section is empty.

Variables

View Source
var ErrShellUnsupported = errors.New("shell execution not supported on this platform")

ErrShellUnsupported reports that the current platform has no supported system shell launcher for PTY-backed sessions.

Functions

func IsPTYCloseError

func IsPTYCloseError(err error) bool

IsPTYCloseError recognizes the EIO returned by many Unix PTY masters after the slave side has closed.

func KillProcessGroup

func KillProcessGroup(command *exec.Cmd)

KillProcessGroup forcefully stops the process group and then kills the leader as a fallback in case group signalling failed.

func NewShellCommand

func NewShellCommand(ctx context.Context, script string) (*exec.Cmd, error)

NewShellCommand constructs the explicitly requested Unix shell invocation. The script is passed as one argument; it is never interpolated by Relayer.

func ProcessGroupExists

func ProcessGroupExists(command *exec.Cmd) bool

ProcessGroupExists reports whether the command's process group still exists.

func TerminateProcessGroup

func TerminateProcessGroup(command *exec.Cmd)

TerminateProcessGroup asks the whole process group led by command to stop. creack/pty starts commands in a new session on Unix, so the command PID is also the process-group ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL