Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.