Skip to content

Releases: charmbracelet/bubbletea

v0.20.0

15 Feb 15:41
Compare
Choose a tag to compare

Force Kill, Bugfixes, and Small Improvements

This is mostly a bugfix release, but there’s also a new feature where you can quit a Bubble Tea program immediately, skipping the final render, but still restoring the terminal state:

p := tea.NewProgram(model{})

go func() {
    if err := p.Start(); err != nil {
        fmt.Println("Oh no:", err)
        os.Exit(1)
    }
}()

// Later
p.Kill()

This can be useful in when to you need fine-grained management over a Bubble Tea program when using something like Wish. Special thanks to @aymanbagabas for implementing this swiftly and acutely.

New

  • Added Kill() method to force quit the program and restore terminal state #219
  • Support batched mouse events #215 (see #212 for details)

Fixed

  • Allocate msgs channel in constructor to fix a data race (thanks @paralin!) #180
  • Handle nil cmds in tea.Sequentially (thanks @ajeetdsouza!) #214
  • tea.Batch now returns nil if all cmds are nil #217
  • Don't check terminal size if output is not a terminal #228

New Contributors

Full Changelog: v0.19.3...v0.20.0


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Slack.

v0.19.3

07 Jan 18:46
Compare
Choose a tag to compare

Altscreen Repaints

This release fixes a small bug where views would render blank if the view’s return value didn’t change after toggling the altscreen.

πŸ€— Special thanks to @chris-miner for flagging this one.


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Slack.

v0.19.2

17 Dec 17:18
Compare
Choose a tag to compare

It’s all about BSD

This release restores support for Dragonfly BSD and fixes a bug where general BSD builds would fail with Go 1.17. BSD users, let us know if you notice anything else is awry.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.19.1

05 Nov 15:31
Compare
Choose a tag to compare

Welcome back, BSD

This update fixes a regression introduced in v0.16.0 that prevented Bubble Tea from building on BSD systems (excluding Darwin).

Here’s the changelog.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.19.0

30 Oct 17:50
Compare
Choose a tag to compare

Final Model Access

This release features Program.StartReturningModel, a handy alternative start method for returning the final Model after a Program exits. This makes it easy to access data collected in a Bubble Tea program while still working in an immutable fashion.

Here’s an example illustrating how it works:

type MyModel struct {
	Name         string
	FaveCatColor string
}

p := tea.NewProgram(MyModel{})

// Return the final model when we're done
finalModel, err := p.StartReturningModel()
if err != nil {
	fmt.Println("Uh oh", err)
	os.Exit(1)
}

// The final model is a generalized tea.Model, so be sure to assert it into
// your actual model type.
if m, ok := finalModel.(MyModel); ok {
	fmt.Printf("Hello, %s. I have a %s kitty for you.\n", m.Name, m.FaveCatColor)
}

πŸ€— A big thanks to @Raphexion for both conceptualizing and executing this feature.

ANSI Compression, Now Opt-In

We’ve also made the ANSI compressor opt-in by default as we noticed that it was incurring a larger performance hit than we’d like in some cases. To enable the ANSI compressor just use the WithANSICompressor program option:

tea.NewProgram(model, tea.WithANSICompressor())

Changelog

Here’s the full changelog for this release.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.18.0

28 Oct 14:20
Compare
Choose a tag to compare

Hello, ANSI compressor!

The big news in this release is the integration of @muesli’s ANSI compressor from his new ANSI package. The compressor, which has been integrated into the renderer, automatically removes redundant ANSI sequences and, as such, it can be considered lossless. This should improve rendering speeds both locally and over the wire.

Other stuff

When quitting a Bubble Tea program from the outside you previously had to…

p.Send(tea.Quit())

…which works, but also feels a little silly. So now you can just…

p.Quit()

Here’s the full changelog.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.17.0

03 Oct 02:03
Compare
Choose a tag to compare

Windows Stuff

This release adds mouse support in Windows! It also fixes a regression introduced in v0.16.0 where the arrow keys didn't work on Windows.

As a side effect to the above, cancelable reads have been disabled in Windows for now. This means applications running in Windows can not run multiple Programs in succession in the context of a single application, nor can user input be reliably read after a Program has exited until the Go application exits. This is temporary and a solution is in development.

Changelog

New

  • Mouse support in Windows

Fixed

  • Arrow keys work properly in Windows again

Changed

  • Input will no longer reliably close on Windows after exiting a Bubble Tea program as it did in v0.16.0. This will be addressed in a subsequent release.

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.16.0

28 Sep 18:58
Compare
Choose a tag to compare

Cancelable Reads

This release implements a cancelable input reader which allows user input to be read after a Program has exited. This means that you can now run multiple Programs in succession in a single application as well as generally read user input in other after a Program has exited in the context of a single application.

In addition, all Goroutines are now gracefully terminated before Program.Start() returns, resulting in reliable behavior between subsequent Programs.

This update has been a major undertaking by @erikgeiser, who built specific implementations for Linux, BSD/macOS, and Windows as well as a general purpose implementation for other flavors of unix.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter or The Fediverse.

The Charm logo

v0.15.0

08 Sep 19:11
Compare
Choose a tag to compare

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

  • Msgs can now be sent to Programs with Program.Send(Msg)
  • WithInputTTY is a new ProgramOption 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.

The Charm logo

v0.14.1

22 Jun 17:14
Compare
Choose a tag to compare

Renderer Bugfix: Honor Explicitly Ignored Lines

This release fixes a bug where lines requested to be ignored weren't always honored by the renderer. Most notably, this affected high performance scrolling in the Bubbles Viewport.


Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or right here in GitHub Discussions.

The Charm logo