termexec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNonZeroExitCode = xerrors.New("non-zero exit code")

Functions

This section is empty.

Types

type Process

type Process struct {
	// contains filtered or unexported fields
}

func StartProcess

func StartProcess(ctx context.Context, args StartProcessConfig) (*Process, error)

func (*Process) Close

func (p *Process) Close(logger *slog.Logger, timeout time.Duration) error

Close closes the process using a SIGINT signal or forcefully killing it if the process does not exit after the timeout. It then closes the pseudo terminal.

func (*Process) ReadScreen

func (p *Process) ReadScreen() string

ReadScreen returns the contents of the terminal window.

func (*Process) Signal

func (p *Process) Signal(sig os.Signal) error

func (*Process) Wait

func (p *Process) Wait() error

Wait waits for the process to exit.

func (*Process) Write

func (p *Process) Write(data []byte) (int, error)

Write sends input to the process via the pseudo terminal.

type StartProcessConfig

type StartProcessConfig struct {
	Program        string
	Args           []string
	TerminalWidth  uint16
	TerminalHeight uint16
}

Jump to

Keyboard shortcuts

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