ptycmd

package
v0.11.17 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
y or Y : Canonical URL