Version: v0.11.22 Latest Latest

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 8 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Cmd

type Cmd struct {
	// contains filtered or unexported fields

Cmd is a shelled out command and an attached pty

func NewCmd

func NewCmd(command string, argv []string, options ...Option) (*Cmd, error)

NewCmd creates a new command attached to a pty

func (*Cmd) Close

func (c *Cmd) Close() error

Close closes the underlying process and the pty

func (*Cmd) Read

func (c *Cmd) Read(p []byte) (n int, err error)

Read reads into the specified buffer from the pty

func (*Cmd) Resize

func (c *Cmd) Resize(width int, height int) error

Resize resizes the terminal of the process

func (*Cmd) Title

func (c *Cmd) Title() string

Title returns a title for the TTY window

func (*Cmd) Write

func (c *Cmd) Write(p []byte) (n int, err error)

Write writes from the specified buffer into the pty

type Option

type Option func(*Cmd)

Option is a configuration option for a Cmd

func WithCloseSignal

func WithCloseSignal(signal syscall.Signal) Option

WithCloseSignal lets you specify the signal to send to the underlying process on close

func WithCloseTimeout

func WithCloseTimeout(timeout time.Duration) Option

WithCloseTimeout lets you specify how long to wait for the underlying process to terminate before sending a SIGKILL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL