Documentation
¶
Overview ¶
Package ptyman owns pseudo-terminal sessions: spawn a process attached to a PTY (ConPTY on Windows), stream its bytes, write input, resize, signal, kill. The interface is ours so the backend is swappable (ADR-006); the first backend delegates to github.com/aymanbagabas/go-pty. Nothing in Phase 0 depends on this package — it exists for the T0 spike and Phase 1 (T11).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = errors.New("ptyman: signal not supported on this platform")
ErrNotSupported is returned for signals the platform cannot honour.
Functions ¶
This section is empty.
Types ¶
type GoPTY ¶
type GoPTY struct{}
GoPTY is the go-pty backed Manager (creack/pty on POSIX, ConPTY on Windows).
type Session ¶
type Session interface {
// Output streams the terminal bytes (what xterm.js renders).
Output() io.Reader
// Write sends bytes to the process's stdin (typed input).
Write(p []byte) (int, error)
// Resize changes the terminal size.
Resize(cols, rows int) error
// Signal pauses/resumes/kills the process. Paused sessions on Windows hold input.
Signal(sig Signal) error
// Wait blocks until the process exits and returns its exit error (nil = 0).
Wait() error
// PID returns the process id (0 before start / after close).
PID() int
// Paused reports the pause state (Windows input-hold or POSIX SIGSTOP).
Paused() bool
// Close releases the PTY; kills the process if still running.
Close() error
}
Session is a running PTY-attached process.