pty

package
v0.3.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInputVisible           = errors.New("terminal input is visible")
	ErrInteractiveUnavailable = errors.New("interactive terminal unavailable")
)

Functions

This section is empty.

Types

type Exit

type Exit struct {
	Cause  string
	Code   *int
	Signal *string
}

type Mode

type Mode string
const (
	ModePTY  Mode = "pty"
	ModePipe Mode = "pipe"
)

type PTY

type PTY interface {
	Start(ctx context.Context, spec ProcSpec) (Proc, error)
}

type Platform

type Platform struct{}

func New

func New() *Platform

func (*Platform) Start

func (p *Platform) Start(ctx context.Context, spec ProcSpec) (Proc, error)

type Proc

type Proc interface {
	PID() int
	ProcessGroupID() int
	StartedAt() time.Time
	Reader() io.Reader
	Write(input []byte) (int, error)
	Resize(cols, rows uint16) error
	Wait(ctx context.Context) (Exit, error)
	Kill(signal Signal) error
	Close() error
}

type ProcSpec

type ProcSpec struct {
	Argv             []string
	Cwd              string
	Env              map[string]string
	Cols             uint16
	Rows             uint16
	Mode             Mode
	MarkerNonce      string
	ShellIntegration bool
}

type RedactedWriteResult

type RedactedWriteResult struct {
	BytesDelivered int
}

type Signal

type Signal string
const (
	SignalINT  Signal = "INT"
	SignalTERM Signal = "TERM"
	SignalKILL Signal = "KILL"
	SignalHUP  Signal = "HUP"
)

Jump to

Keyboard shortcuts

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