class

Tea::Program

Inherits Reference < Object

Extend Program class with TTY functionality

Constants

SUSPEND_SUPPORTED = true

Suspension support flag

Constructors

new(initial_model : Model | Nil = nil)
Source

Instance methods

check_resize

Check and report terminal resize

Source
disable_catch_panics=(disable_catch_panics : Bool)
Source
disable_catch_panics?
Source
disable_input=(disable_input : Bool)
Source
disable_input?
Source
disable_renderer=(disable_renderer : Bool)
Source
disable_renderer?
Source
disable_signal_handler=(disable_signal_handler : Bool)
Source
disable_signal_handler?
Source
env

Environment

Source
env=(env : Ultraviolet::Environ)

Environment

Source
exec(cmd : ExecCommand, callback : ExecCallback | Nil)

exec runs an ExecCommand and delivers results to the program Matches Go's exec method logic exactly

Source
execute(sequence : String)

Execute writes an ANSI sequence to the output buffer

Source
external_context
Source
external_context=(external_context : ExecutionContext | Nil)
Source
filter
Source
filter=(filter : Proc(Model, Msg, Msg | Nil) | Nil)
Source
flush

Flush writes the output buffer to the actual output

Source
fps

Configuration options

Source
fps=(fps : Int32)

Configuration options

Source
height
Source
height=(height : Int32)
Source
ignore_signals=(ignore_signals : Bool)

Internal state

Source
ignore_signals?

Internal state

Source
init_input

Initialize TTY input (set raw mode, etc.) Platform-specific implementation

Source
init_input_reader(cancel : Bool = false) : Exception | Nil

(Re)start input reading

Source
init_terminal

Initialize terminal (called at program start)

Source
initial_model
Source
initial_model=(initial_model : Model | Nil)
Source
input

Input handling

Source
input=(input : IO | Nil)

Input handling

Source
kill

Kill stops the program immediately and restores terminal state

Source
listen_for_resize(done : Channel(Nil))

Listen for window resize events (SIGWINCH on Unix)

Source
output

Output handling

Source
output=(output : IO | Nil)

Output handling

Source
profile

Color profile override (nil = auto-detect from renderer/terminal)

Source
profile=(profile : Ultraviolet::ColorProfile | Nil)

Color profile override (nil = auto-detect from renderer/terminal)

Source
quit

Quit the program

Source
release_terminal(reset : Bool) : Exception | Nil

releaseTerminal releases terminal control for external commands

Source
restore_input

Restore TTY input to original state

Source
restore_terminal

restore_terminal restores terminal control after external commands

Source
restore_terminal_state

Restore terminal to original state

Source
run(context : ExecutionContext | Nil = nil) : Tuple(Model | Nil, Exception | Nil)

Start the program with the given context ameba:disable Metrics/CyclomaticComplexity

Source
running?

Check if the program is running

Source
send(cmd : Cmd | Nil)

Send a command to be executed

Source
send(msg : Msg)

Send a message to the program

Source
shutdown(kill : Bool)

Shutdown performs cleanup and restores terminal state

Source
startup_alt_screen=(startup_alt_screen : Bool)
Source
startup_alt_screen?
Source
startup_bracketed_paste=(startup_bracketed_paste : Bool)
Source
startup_bracketed_paste?
Source
startup_mouse_mode
Source
startup_mouse_mode=(startup_mouse_mode : MouseMode | Nil)
Source
startup_report_focus=(startup_report_focus : Bool)
Source
startup_report_focus?
Source
suspend

Suspend the program (send SIGTSTP)

Source
translate_input_event(event : Ultraviolet::Event) : Msg

translate_input_event translates an ultraviolet event into a Bubble Tea message Matches Go's translateInputEvent function ameba:disable Metrics/CyclomaticComplexity

Source
wait

Wait blocks until the program finishes

Source
width

Terminal dimensions

Source
width=(width : Int32)

Terminal dimensions

Source