pty

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 6 Imported by: 0

README

pty

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProcessNotStarted = errors.New("process has not been started")
	ErrInvalidCmd        = errors.New("invalid command")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	// Command holds command line arguments, including the command as Command[0].
	// If the Command field is empty or nil, Run uses {Path}.
	Command []string

	// Dir sets the current working directory for the command
	Dir string

	// Env sets the environment variables. Use the format VAR=VAL.
	Env []string

	// Initial size for Columns and Rows
	Cols uint32
	Rows uint32
}

type Pty

type Pty interface {
	// Start
	Start() error

	// Stdio returns stdio of pty
	Stdio() (io.ReadWriteCloser, error)

	// SetSize sets the console size
	SetSize(cols uint32, rows uint32) error

	// GetSize gets the console size
	GetSize() (uint32, uint32, error)

	// Process returns the process
	Process() (*os.Process, error)
}

Pty communication interface

func NewPty

func NewPty(opt Options) (Pty, error)

NewPty creates a new pty

Jump to

Keyboard shortcuts

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