module

Term2::Cmds

Extend Cmds module with exec_process

Class methods

after(duration : Time::Span, msg : Msg) : Term2::Cmd

Schedule a message after a duration.

Source
after(duration : Time::Span, &block : -> Msg | Nil) : Term2::Cmd
Source
batch(cmds : Array(Term2::Cmd | Nil)) : Term2::Cmd

Run several commands concurrently - array version.

Source
batch(*cmds : Term2::Cmd) : Term2::Cmd

Run several commands concurrently.

Source
clear_screen
Source
deadline(target : Time, msg : Msg) : Term2::Cmd
Source
deadline(target : Time, &block : -> Msg | Nil) : Term2::Cmd
Source
disable_bracketed_paste
Source
disable_mouse_tracking
Source
disable_report_focus
Source
enable_bracketed_paste
Source
enable_mouse_all_motion
Source
enable_mouse_cell_motion
Source
enable_report_focus
Source
enter_alt_screen

Internal/terminal related helper constructors mirror the old Cmd API for convenience.

Source
every(duration : Time::Span, &block : Time -> Msg | Nil) : Term2::Cmd

Every is a command that ticks after a duration. Like Bubble Tea, this sends a single message - to tick repeatedly, return another Every command from your update function.

Source
exec_process(cmd : String, args : Array(String) = [] of String, env : Hash(String, String) | Nil = nil, &block : Exception | Nil -> Msg | Nil) : Term2::Cmd

Creates a command that runs an external process. The terminal is paused (raw mode disabled) while the command runs. The block receives the error (if any) or nil when the process finishes.

Source
exec_process(cmd : String, args : Array(String) = [] of String, env : Hash(String, String) | Nil = nil) : Term2::Cmd

Creates a command that runs an external process without a callback.

Source
exit_alt_screen
Source
from_event(evt : CML::Event(Msg)) : Term2::Cmd
Source
hide_cursor
Source
interrupt
Source
map(cmd : Term2::Cmd, &block : Msg -> Msg | Nil) : Term2::Cmd

Map the result of a command.

Source
message(msg : Msg) : Term2::Cmd

Immediately emit a single message.

Source
none

No-op command (nil)

Source
perform
Source
printf(format : String, *args) : Term2::Cmd
Source
println(text : String) : Term2::Cmd
Source
quit
Source
sequence(cmds : Array(Term2::Cmd | Nil)) : Term2::Cmd

Run commands sequentially - array version.

Source
sequence(*cmds : Term2::Cmd) : Term2::Cmd

Run commands sequentially.

Source
show_cursor
Source
suspend
Source
tick(duration : Time::Span, &block : Time -> Msg | Nil) : Term2::Cmd

Tick sends a message after a duration (alias for every).

Source
timeout(duration : Time::Span, timeout_message : Msg, &block : -> Msg | Nil) : Term2::Cmd
Source
window_size
Source
window_title=(title : String) : Term2::Cmd
Source