Expand description
Cleanroom Rust port of upstream Go source file: commands.go
Upstream Target Tag / Version: v2.0.8
Built-in command functions (batch, sequence, every, tick, request_window_size).
Structs§
- Batch
Msg - BatchMsg is a message used to perform a bunch of commands concurrently with
no ordering guarantees. You can send a BatchMsg with
batch. - Interrupt
Msg - InterruptMsg signals the program should interrupt. This usually happens when ctrl+c is pressed on common programs, but since bubbletea puts the terminal in raw mode, we need to handle it in a per-program basis.
- QuitMsg
- QuitMsg signals the program to exit.
- Request
Window Size Msg - RequestWindowSizeMsg is a message that requests terminal window size.
- Resume
Msg - ResumeMsg can be listened to do something once a program is resumed back from a suspend state.
- Sequence
Msg - SequenceMsg is used internally to run the given commands in order.
- Suspend
Msg - SuspendMsg signals the program should suspend. This usually happens when ctrl+z is pressed on common programs, but since bubbletea puts the terminal in raw mode, we need to handle it in a per-program basis.
Functions§
- batch
- Batch performs a bunch of commands concurrently with no ordering guarantees
about the results. Use
batchto return several commands. - every
- Every is a command that ticks in sync with the system clock. So, if you wanted to tick with the system clock every second, minute or hour you could use this. It’s also handy for having different things tick in sync.
- interrupt
- Interrupt is a special command that tells the Bubble Tea program to interrupt.
- quit
- Quit is a command that signals the program to exit.
- request_
window_ size - RequestWindowSize is a command that queries the terminal for its current
size. It delivers the results to
updatevia aWindowSizeMsg. Keep in mind thatWindowSizeMsgs will automatically be delivered toupdatewhen the Program starts and when the window dimensions change, so in many cases you will not need to explicitly invoke this command. - sequence
- Sequence runs the given commands one at a time, in order. Contrast this with
batch, which runs commands concurrently. - suspend
- Suspend is a special command that tells the Bubble Tea program to suspend.
- tick
- Tick produces a command at an interval independent of the system clock at the given duration. That is, the timer begins precisely when invoked, and runs for its entire duration.