class

Opal::Asciicast::Writer

Inherits Reference < Object

Generates standard Asciinema v2 format recordings (.cast). Spec: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md

Constructors

new(width : Int32 = 80, height : Int32 = 24, title : String = "Opal Demo", term : String = "xterm-256color", shell : String = "/bin/bash", theme : Hash(String, String) | Nil = nil, idle_time_limit : Float64 | Nil = nil)
Source

Instance methods

clear_screen(advance : Float64 = 0.02) : Nil

Clears the terminal screen and homes the cursor

Source
current_time
Source
draw_buffer(buf : UI::Buffer, advance : Float64 = 0.05) : Nil

Draws a full Buffer into the cast without clearing the screen, ensuring flicker-free terminal updates with full ANSI color styling.

Source
elapsed
Source
events
Source
header
Source
height
Source
move_to(row : Int32, col : Int32, advance : Float64 = 0.01) : Nil

Moves cursor to row, col

Source
pause(seconds : Float64) : Nil

Pauses playback by advancing elapsed time

Source
save(filename : String) : Nil

Saves the asciicast file (UTF-8 without BOM)

Source
title
Source
to_s(io : IO) : Nil

Generates the complete .cast file contents as a string

Source
type_text(text : String, cps : Float64 = 16.0, jitter : Float64 = 0.02) : Nil

Simulates human typing cadence for a string

Source
width
Source
write(data : String, advance : Float64 = 0.05) : Nil

Writes an output event [time, "o", data] with a time advance

Source
write_input(data : String, advance : Float64 = 0.0) : Nil

Writes an input event [time, "i", data]

Source
write_marker(label : String, advance : Float64 = 0.0) : Nil

Writes a marker event [time, "m", label]

Source