recorder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package recorder implements asciinema v2 terminal recording.

It wraps os.Stdout with a tee writer so that all terminal output is captured into a .cast file in asciicast v2 format. SIGWINCH events are captured and written as resize events.

Usage:

err := recorder.DefaultRecorder.Start("/path/to/output.cast")
defer recorder.DefaultRecorder.Stop()

Index

Constants

This section is empty.

Variables

View Source
var DefaultRecorder = &Recorder{}

DefaultRecorder is the package-level recorder instance used by /record.

Functions

func RecordingPath

func RecordingPath() (string, error)

RecordingPath returns the default path for a new recording using the current time as a stable, unique suffix.

Types

type Recorder

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

Recorder captures terminal output into an asciicast v2 file.

func (*Recorder) FilePath

func (r *Recorder) FilePath() string

FilePath returns the path of the current recording file, or empty string.

func (*Recorder) IsRecording

func (r *Recorder) IsRecording() bool

IsRecording returns true if a recording is in progress.

func (*Recorder) Start

func (r *Recorder) Start(path string) error

Start begins recording to the given path. It wraps os.Stdout with a tee so subsequent writes are captured. Note: if Bubble Tea has already started writing, only output after this call is captured. Call before tea.NewProgram for a full session recording.

func (*Recorder) Stop

func (r *Recorder) Stop() error

Stop finalises the recording and restores os.Stdout.

Jump to

Keyboard shortcuts

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