arizona_terminal_effect (arizona v0.4.0)

View Source

Framework terminal effect builders for ?terminal views -- the terminal analog of arizona_js (web) and arizona_android (native).

A view returns these from handle_event/3 / handle_info/2, and the terminal driver interprets them. arizona_terminal_default_driver handles all three; a custom driver may handle more (or fewer). Each builds the neutral arizona_effect:cmd/0 tuple the other targets use.

These are frame-orthogonal -- they don't depend on the paint model, so they work with the default full-frame repaint. Append-only output like a scrolling log is a paint-model concern and stays the responsibility of a custom driver.

handle_event(~"key", #{key := $q}, Bindings) ->
    {Bindings, #{}, [arizona_terminal_effect:quit()]}.

Summary

Functions

Ring the terminal bell.

Stop the terminal session: the driver tears down (restores the terminal) and exits.

Set the terminal window/icon title.

Functions

bell()

-spec bell() -> arizona_effect:cmd().

Ring the terminal bell.

quit()

-spec quit() -> arizona_effect:cmd().

Stop the terminal session: the driver tears down (restores the terminal) and exits.

set_title(Title)

-spec set_title(Title) -> arizona_effect:cmd() when Title :: iodata().

Set the terminal window/icon title.