Documentation
¶
Overview ¶
Package termrec records what a program writes to a terminal, saves it as an asciinema cast, and plays it back as an animated GIF.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmpty = errors.New("nothing was written to the terminal")
ErrEmpty is returned by GIF for a recording with nothing in it.
Functions ¶
func Frame ¶
Frame returns frame n of an animated GIF as it looks on screen, counting from 1. n <= 0, or past the end, is the last frame.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder is an io.Writer that records what is written to it.
func NewRecorder ¶
NewRecorder starts a recording of a cols by rows terminal.
type Recording ¶
Recording is a terminal session: the bytes written to the screen, and when.
func (Recording) FullScreen ¶ added in v1.3.0
FullScreen reports whether rec switched to the terminal's alternate screen, as full-screen programs such as vim, less and top do.
func (Recording) Text ¶ added in v1.3.0
Text is what rec wrote, as plain text that reads the way the terminal showed it: escape sequences are dropped, a carriage return starts its line over, a backspace steps back and erasing to the end of the line erases. Trailing spaces and blank lines at the end are left off.
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen is a terminal emulator to write a program's output to, for reading what it shows.