Documentation
¶
Overview ¶
Package tape reads the input commands of VHS tape files (https://github.com/charmbracelet/vhs) and plays them as keystrokes, so a block that needs a terminal can run without a person typing.
Index ¶
Constants ¶
const ( DefaultTypingSpeed = 50 * time.Millisecond DefaultWaitTimeout = 15 * time.Second DefaultWaitPattern = `>$` )
Defaults match VHS.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
Line int
// Keys are written Count times, or Text is typed a character at a
// time, Speed apart.
Keys string
Count int
Text string
// Literal is set when Text was in single quotes or backticks, which
// mdsh types as they are, without filling in placeholders.
Literal bool
Speed time.Duration // 0 means the tape's typing speed
// Sleep pauses for this long.
Sleep time.Duration
// Wait pauses until the screen matches Pattern (nil means the tape's
// wait pattern), or Timeout passes (0 means the tape's wait timeout).
Wait bool
Pattern *regexp.Regexp
WaitScreen bool // match the whole screen, not the last line
Timeout time.Duration
// Set changes a setting: TypingSpeed, WaitTimeout or WaitPattern.
Set, Value string
}
Command is one line of a tape.