tc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RawMode

func RawMode(t *Termcorder) error

RawMode sets standard in in raw mode.

func Record

func Record(c *exec.Cmd, options ...OptionFunc) error

Record creates a new Termcording and starts it.

Types

type OptionFunc

type OptionFunc func(*Termcorder) error

OptionFunc defines a parameter function.

func InheritSizeFrom

func InheritSizeFrom(from *os.File) OptionFunc

InheritSizeFrom sets up and returns a parameter function that initially sets the size of pty, then launches the resize handler in a go routine.

func WithInputReaders

func WithInputReaders(readers ...io.Reader) OptionFunc

WithInputReaders sets up and returns a parameter function that sets the recorder's input readers (what input is copied to the pty).

func WithInputWriters

func WithInputWriters(writers ...io.Writer) OptionFunc

WithInputWriters sets up and returns a parameter function that sets the recorder's input writers (what, in addition to the pty, is the input copied to).

func WithOutputWriters

func WithOutputWriters(writers ...io.Writer) OptionFunc

WithOutputWriters sets up and returns a parameter function that sets the recorder's output writers (where the pty's output is copied to).

type Termcorder

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

Termcorder holds all values required to record a command run.

func NewTermcorder

func NewTermcorder(c *exec.Cmd, options ...OptionFunc) (*Termcorder, error)

NewTermcorder creates a new Termcorder instance, setting up and hooking the pty to a given command, and configuring readers/writers.

func (*Termcorder) Start

func (t *Termcorder) Start() error

Start starts the command in the setup pty, copying readers to writers for both input and output.

Jump to

Keyboard shortcuts

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