Term2
Term2 is a Crystal port of the Bubble Tea terminal UI library.
Constants
Human-readable names for key types.
Maps KeyType enum values to their string representations used
in Key#to_s and for matching in Key#matches?.
Term2::KEY_NAMES[KeyType::CtrlC] # => "ctrl+c"
Term2::KEY_NAMES[KeyType::Up] # => "up"
Term2::KEY_NAMES[KeyType::F1] # => "f1"
NoTabConversion can be passed to TabWidth to disable tab replacement
Tab width default
Class methods
Batch performs a bunch of commands concurrently with no ordering guarantees. Use a Batch to return several commands from Init or Update.
def init : Term2::Cmd
Term2.batch(load_data_cmd, start_timer_cmd)
end
Join strings horizontally with alignment
Join strings vertically with alignment
Log to a file with prefix, returning the opened file.
Place content within a box of given dimensions
Dispatcher bridges commands to the program's message mailbox. Run the program with the given model.
Sequence runs the given commands one at a time, in order. Contrast this with Batch, which runs commands concurrently.
Apply styles to specific rune (grapheme) indices.
Nested types
- Term2::AdaptiveColor
- Term2::BatchMsg
- Term2::BlurMsg
- Term2::Border
- Term2::ClearScreenMsg
- Term2::Cmd
- Term2::Cmds
- Term2::Color
- Term2::ColorProfile
- Term2::CompleteColor
- Term2::Components
- Term2::Cursor
- Term2::DisableBracketedPasteMsg
- Term2::DisableMouseTrackingMsg
- Term2::DisableReportFocusMsg
- Term2::Dispatcher
- Term2::Edges
- Term2::EnableBracketedPasteMsg
- Term2::EnableMouseAllMotionMsg
- Term2::EnableMouseCellMotionMsg
- Term2::EnableReportFocusMsg
- Term2::EnterAltScreenMsg
- Term2::ExecError
- Term2::ExecMsg
- Term2::ExitAltScreenMsg
- Term2::FocusMsg
- Term2::HideCursorMsg
- Term2::Key
- Term2::KeyBinding
- Term2::KeyMsg
- Term2::KeyPress
- Term2::KeyReader
- Term2::KeySequences
- Term2::KeyType
- Term2::LipglossRenderer
- Term2::Message
- Term2::Model
- Term2::Mouse
- Term2::MouseEvent
- Term2::MouseReader
- Term2::Msg
- Term2::NilRenderer
- Term2::Position
- Term2::Prelude
- Term2::PrintMsg
- Term2::Program(M)
- Term2::ProgramContext
- Term2::ProgramKilled
- Term2::ProgramOption
- Term2::ProgramOptions
- Term2::ProgramPanic
- Term2::QuitMsg
- Term2::Range
- Term2::Renderer
- Term2::RequestWindowSizeMsg
- Term2::ResumeMsg
- Term2::SequenceMsg
- Term2::SetWindowTitleMsg
- Term2::ShowCursorMsg
- Term2::StandardRenderer
- Term2::Style
- Term2::StyleRenderer
- Term2::StyleTable
- Term2::SuspendMsg
- Term2::Terminal
- Term2::Text
- Term2::UnknownCSISequenceMsg
- Term2::WindowSizeMsg
- Term2::WithANSICompressor
- Term2::WithAltScreen
- Term2::WithContext
- Term2::WithEnvironment
- Term2::WithFPS
- Term2::WithFilter
- Term2::WithInput
- Term2::WithInputTTY
- Term2::WithMouseAllMotion
- Term2::WithMouseCellMotion
- Term2::WithOutput
- Term2::WithReportFocus
- Term2::WithoutBracketedPaste
- Term2::WithoutCatchPanics
- Term2::WithoutRenderer
- Term2::WithoutSignalHandler
- Term2::Zone
- Term2::ZoneClickMsg
- Term2::ZoneFocusMsg
- Term2::ZoneInBoundsMsg
- Term2::ZoneInfo
- Term2::ZoneMouseAction
- Term2::ZoneMouseButton
- Term2::ZoneMouseEvent