github charmbracelet/bubbletea v0.20.0

latest releases: v1.1.2, v2.0.0-alpha.1, v1.1.1...
2 years ago

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.

Don't miss a new bubbletea release

NewReleases is sending notifications on new releases.