Interop and Inputs
The big, new feature in this update is Program.Send(Msg)
, which allows you to send messages to the Update
loop from outside a Bubble Tea program. This simplifies Bubble Tea’s interoperability with other libraries quite a lot and we’re excited to see what you do with it.
Beyond that, we’ve made a lot of small changes under the hood to allow Bubble Tea to work better with more types of terminal input such as PTYs over SSH. The program option WithInputTTY
has also been added to make it easier to open a TTY (or console input device on Windows) on demand.
Changelog
New
Msg
s can now be sent toProgram
s withProgram.Send(Msg)
WithInputTTY
is a newProgramOption
for explicitly opening a new TTY (or console on Windows) for input
Fixed
- Fixed a send on closed channel panic that could happen during a shutdown when messages are being sent super fast
- The cursor will now always hide/show itself during startup/shutdown, regardless of whether input is a terminal
- Input will now attempt to be read regardless of whether input is a terminal
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.