Raxol.UI.Components.Terminal (Raxol v2.0.1)
View SourceA terminal component that emulates a standard terminal within the UI.
Summary
Functions
Handles key events for the Terminal component.
Initializes the Terminal component state from props.
Mount hook - called when component is mounted. No special setup needed for Terminal.
Renders the Terminal component, displaying the buffer as lines.
Unmount hook - called when component is unmounted. No cleanup needed for Terminal.
Updates the Terminal component state in response to messages. Handles writing, clearing, etc.
Types
@type t() :: %Raxol.UI.Components.Terminal{ buffer: [String.t()], height: non_neg_integer(), id: any(), style: map(), width: non_neg_integer() }
State for the Terminal component.
- :id - unique identifier
- :width - terminal width
- :height - terminal height
- :buffer - list of lines
- :style - style map
Functions
@spec handle_event(map(), map(), map()) :: {map(), list()}
@spec handle_event(map(), map(), map()) :: {map(), list()}
Handles key events for the Terminal component.
Initializes the Terminal component state from props.
Mount hook - called when component is mounted. No special setup needed for Terminal.
Renders the Terminal component, displaying the buffer as lines.
Unmount hook - called when component is unmounted. No cleanup needed for Terminal.
Updates the Terminal component state in response to messages. Handles writing, clearing, etc.