A powerful little TUI framework đ
Fix panics! Using program.SetWindowTitle
and others may panic if they were called before the program starts.
Also note that program.SetWindowTitle
is now deprecated. To set the window title use tea.SetWindowTitle
command.
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.26.3...v0.26.4
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This is a patch release that prevents tea.WindowSizeMsg
s from being fired during altscreen changes on Windows. This was due to the fact that Windows emits a window-size-event
on altscreen changes even if the size handât changed. Now, we cache the window-size and compare before sending the message to the Model
.
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.26.2...v0.26.3
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This fixes a small regression that was introduced in v0.26.0 related to the first line on the first render not being displayed correctly. Thank you @mistakenelf for pointing this out in https://github.com/charmbracelet/bubbletea/issues/1000!
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.26.1...v0.26.2
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This is a quick one to fix a Windows shortcoming in the last release acutely identified by our pal @jon4hz. Thank you!
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.26.0...v0.26.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
What do tapioca balls, IBM mainframes, and the Microsoft Windows Console API have in common? Bubble Tea v0.26.0, thatâs what. Letâs get to it.
A few years ago @erikgeiser, a penetration tester and ex-particle physicist, wrote this awesome library called coninput to majorly improve Bubble Tea input on Windows. @aymanbagabas has implemented the library in Bubble Tea and input on Windows is roughly 1000 times better now. In the short term, this means that for Windows users inputting non-Latin characters (like Greek, Cyrillic, Korean, Chinese and so on) stuff will âjust work.â
The bigger news, however, is that this paves the way for Windows parity with our forthcoming support for super high fidelity input via Kitty Keyboard and Fixterms.
Terminal emulators on Windows donât support the SIGWINCH
signal, which is sent when the terminal is resized. Itâs been a huge bummer for a really long time. Thanks (again) to @erikgeiser and @aymanbagabas, weâre now able to reach deep into Windowsâ underpinnings, detect window resizes, and send tea.WindowSizeMsg
s accordingly! This is a glorious moment for Bubble Tea on Windows indeed.
While building a query editor for a CockroachDB client, @knz noticed that Bubble Tea didn't support Bracketed Paste. Performance-wise, that sucks because it means pasting large bodies of text (like SQL queries) will normally be seen as a bunch of little successive keypresses. Thatâs where Bracketed Paste comes in. When enabled at the terminal-level Bracketed Paste lets you slam down a bunch of text with one big, fat input event.
Bubble Tea enables bracketed paste by default, however you can opt out of it with the WithoutBracketedPaste()
program option:
p := tea.NewProgram(myCuteModel, tea.WithoutBracketedPaste())
You can also enable and disable it on demand with the EnableBracketedPaste()
and DisableBracketedPaste()
commands.
tea.Println
In case you forgot, tea.Println
(and itâs brother tea.Printf
) is a Cmd
that lets you print unmanaged output above a Bubble Tea program, similar to what you see with package managers like apt-get
. Thanks to @Adjective-Object (who also implemented tea.Println
in the first place) now you can send multi-line output, too. For a tea.Println
refresher see the package manager example.
Donât you think itâs about time we all ran Bubble Tea apps on our mainframes? Thanks to @dustin-ward that dream is now a reality, so long as you have a z/OS mainframe. We're thrilled to announce that Bubble Tea is now fully supported on z/OS.
Bugfixes are the unsung heroes that sometimes get buried below the feature listings. This release has them and theyâre good ones; see the changelog below for details.
tea.Println()
messages by @Adjective-Object in https://github.com/charmbracelet/bubbletea/pull/490
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.25.0...v0.25.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
We hope youâre ready for winter. Unless youâre in the southern hemisphere (like @caarlos0) in which case, we hope youâre ready for summer. In either case, we hope you have a happy new year if the Julian calendar is something youâre into.
There are a bunch of good features in this release and a ton of input-related improvements. Read on for more!
Bubble Tea now supports Extended Mouse Mode (aka SGR mode) which makes now mouse support in Bubble Tea way, way better.
Prior to this release Bubble Tea used the X10 mouse protocol. X10 was last released in 1986: a time when screen resolutions were smaller, memory limits were low, and a terminal sizes were tiny. For terminals and mice this meant that the mouse tracking stopped after the 127th horizontal cell. Well, thanks to the elite abilities of @aymanbagabas Bubble Tea can now track mouse movements across the entire terminal window, no matter how enormous.
And that's not all: Bubble Tea now has higher fidelity access to mouse operations such as shift, ctrl, and alt modifiers, mouse button release events, and a big range of mouse button and mouse wheel events.
For details see the docs for the new and improved MouseEvent
.
@aymanbagabas also wanted to be able to set the terminal window title with Bubble Tea, so he added the SetWindowTitle
Cmd
. Now setting the window title is as simple as:
func (m Model) Update(msg tea.Msg) (tea.Model. tea.Cmd) {
return m, tea.SetWindowTitle("oh my")
}
Have you ever thought âBubble Tea is too fast and I just canât handle it?â Or perhaps 60fps is too slow and you want to go full 120fps. Now, thanks to @tomfeiginâs WithFPS
ProgramOption
you can:
// Letâs go with the classic soap opera frame rate
p := tea.NewProgram(model, tea.WithMaxFPS(45))
@knz is just incredible. He took a look at Bubble Teaâs input parser and whipped it into shape with what felt like a flick of the wrist. Keyboard input is now more efficient than ever and very large amounts of input can be parsed with the greatest of ease. It's hard to overstate how impactful his contributions areâand there are more in the pipe.
SetWindowTitle
command by @aymanbagabas in https://github.com/charmbracelet/bubbletea/pull/611
ReleaseTerminal
/RestoreTerminal
thread safe by @caarlos0 in https://github.com/charmbracelet/bubbletea/pull/791
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.24.2...v0.25.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This point release fixes a race condition that could occur when stopping the default renderer:
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.24.1...v0.24.2
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This point release fixes a regression introduced in v0.24.0
in which keyboard and mouse input would be lost when piping and redirecting into a program with default inputs. Special thanks to @pomdtr forâŠpiping up about the regression.
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.24.0...v0.24.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
It is finally time for another Bubble Tea release!
This release contains 31 commits by 14 contributors. Thank you everyone! đ
Without further ado, here's a list of the most important changes:
The tea.QuitMsg
is now exported and you can use tea.WithFilter
to filter which messages your model will receive:
func filter(m tea.Model, msg tea.Msg) tea.Msg {
if _, ok := msg.(tea.QuitMsg); !ok {
return msg
}
model := m.(myModel)
if model.hasChanges {
return nil
}
return msg
}
p := tea.NewProgram(Model{}, tea.WithFilter(filter));
if _,err := p.Run(); err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
}
We are introducing an our very own /x
package, which contains the teatest
package.
With teatest
, you can easily run a tea.Program
, assert its final model and/or output.
This package required a couple of new methods on Bubble Tea, namely Program.Wait()
, WithoutSignals
.
You can see an example usage in the simple
example.
We try hard to not let any of them pass, but we know, sometimes a few of them do. This release also gets rid of a bunch of them.
Full Changelog: https://github.com/charmbracelet/bubbletea/compare/v0.23.2...v0.24.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This is a small maintenance release with two small but acute fixes from our wonderful community. Thanks for the support! đ
Msg
Cmd
is not nil before invoking (to avoid a nil pointer exception) by @nderjung in https://github.com/charmbracelet/bubbletea/pull/640
BatchMsg
to Sequence
by @stoffeastrom in https://github.com/charmbracelet/bubbletea/pull/581
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.