Tea
Constants
Default and max framerate constants
Go parity key code constants re-exported from Ultraviolet.
KeyMod constants from mod.go These are aliases to Ultraviolet values for API compatibility
Go parity constants for MouseMode values.
Mouse button constants (aliases to UV constants) Based on X11 mouse button codes: 1 = left button 2 = middle button (pressing the scroll wheel) 3 = right button 4 = turn scroll wheel up 5 = turn scroll wheel down 6 = push scroll wheel left 7 = push scroll wheel right 8 = 4th button (aka browser backward button) 9 = 5th button (aka browser forward button) 10, 11 = additional buttons
Go parity constants for ProgressBarState values.
Class methods
ClearScreen clears the screen before the next update. This can be used to move the cursor to the top left of the screen and clear visual clutter when the alt screen is not in use.
Encode cursor style into DECSCUSR numeric value. 1: blinking block, 2: steady block, 3: blinking underline, 4: steady underline, 5: blinking bar, 6: steady bar.
Every ticks in sync with the system clock
Exec runs an ExecCommand in a blocking fashion, pausing the Program while execution is running and resuming when complete
ExecProcess runs the given executable in a blocking fashion. This mirrors Go's exec.Command + tea.ExecProcess behavior: the command is configured first, then started during program exec with stdio attached.
Convenience method to exec a shell command
Helper to create a Key from a special key type
LogToFile sets up logging to a file with the given path and prefix. This is helpful since the TUI occupies the terminal. If the file doesn't exist, it will be created.
Don't forget to close the file when you're done:
file = Tea.log_to_file("debug.log", "debug")
... use program ...
file.close
Returns the file handle or raises on error.
LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.
Block-based helper for local custom setup.
Helper to create a mouse message
Factory method to create a new cursed renderer
Go parity helper for NewCursor().
Create a new program with the given model and options
Go parity helper for NewProgressBar().
Raw prints the given string to the terminal without any formatting. This is intended for advanced use cases where you need to query the terminal or send escape sequences directly.
ReadPrimaryClipboard produces a command that reads the primary clipboard (X11/Wayland)
RequestCapability is a command that requests the terminal to send its Termcap/Terminfo response for the given capability.
Bubble Tea recognizes the following capabilities:
- "RGB" Xterm direct color
- "Tc" True color support
RequestTerminalVersion is a command that queries the terminal for its version using XTVERSION. Note that some terminals may not support this.
RequestWindowSize is a message that requests terminal size check. Go parity: RequestWindowSize() Msg.
Sequentially runs commands in order, returns first non-nil result Deprecated: use sequence instead
SetClipboard produces a command that sets the system clipboard using OSC52 Note: OSC52 is not supported in all terminals ameba:disable Naming/AccessorMethodName
SetPrimaryClipboard produces a command that sets the primary clipboard (X11/Wayland) ameba:disable Naming/AccessorMethodName
SetWindowTitle produces a command that sets the terminal title ameba:disable Naming/AccessorMethodName
Tick produces a command at a fixed interval
Wrap any value as a Msg. If the value is already a Msg, return it directly. Otherwise, wrap it in Value.
Nested types
- Tea::BackgroundColorMsg
- Tea::BatchMsg
- Tea::BlurMsg
- Tea::CapabilityMsg
- Tea::ClearScreenMsg
- Tea::ClipboardMsg
- Tea::Cmd
- Tea::ColorProfileMsg
- Tea::CursedRenderer
- Tea::Cursor
- Tea::CursorColorMsg
- Tea::CursorPositionMsg
- Tea::CursorShape
- Tea::CursorStyle
- Tea::EnvMsg
- Tea::ExecCallback
- Tea::ExecCommand
- Tea::ExecMsg
- Tea::ExecutionContext
- Tea::FocusMsg
- Tea::ForegroundColorMsg
- Tea::InterruptMsg
- Tea::InterruptedError
- Tea::Key
- Tea::KeyMod
- Tea::KeyModHelpers
- Tea::KeyMsg
- Tea::KeyPressMsg
- Tea::KeyReleaseMsg
- Tea::KeyboardEnhancements
- Tea::KeyboardEnhancementsMsg
- Tea::LogOptionsSetter
- Tea::ModeReportMsg
- Tea::Model
- Tea::Mouse
- Tea::MouseButton
- Tea::MouseClickMsg
- Tea::MouseMode
- Tea::MouseMotionMsg
- Tea::MouseMsg
- Tea::MouseReleaseMsg
- Tea::MouseWheelMsg
- Tea::Msg
- Tea::NilRenderer
- Tea::OSExecCommand
- Tea::Options
- Tea::PasteEndMsg
- Tea::PasteMsg
- Tea::PasteStartMsg
- Tea::Position
- Tea::PrintLineMsg
- Tea::Program
- Tea::ProgramKilledError
- Tea::ProgramOption
- Tea::ProgramPanicError
- Tea::ProgressBar
- Tea::ProgressBarState
- Tea::QuitMsg
- Tea::RawMsg
- Tea::ReadClipboardMsg
- Tea::ReadPrimaryClipboardMsg
- Tea::Renderer
- Tea::RequestBackgroundColorMsg
- Tea::RequestCapabilityMsg
- Tea::RequestCursorColorMsg
- Tea::RequestForegroundColorMsg
- Tea::ResumeMsg
- Tea::Screen
- Tea::SequenceMsg
- Tea::SetClipboardMsg
- Tea::SetPrimaryClipboardMsg
- Tea::SetWindowTitleMsg
- Tea::ShellCommand
- Tea::SuspendMsg
- Tea::TTY
- Tea::TerminalVersionMsg
- Tea::TerminalVersionRequestMsg
- Tea::Value(T)
- Tea::View
- Tea::WindowSizeMsg
- Tea::WindowSizeRequestMsg