Skip to content

Releases: charmbracelet/bubbletea

v0.22.1

19 Aug 20:15
31800cd
Compare
Choose a tag to compare

Mutli-Byte Character Support on Windows

This is a small release with a big impact for Chinese, Japanese, and Korean users on Windows. The long as short of it is that if youโ€™re using a multi-byte character set thatโ€™s not UTF-8, Bubble Tea will covert stuff for you so things work as expected. For details see #343.

๐Ÿค— Enormous thanks to @mattn for the contribution as well as his Go libraries that make CJK support in the Charm ecosystem possible.

๐Ÿ‘พ Also, thanks to @aklyachkin, if Bubble Tea on AIX is something you want your dream is a now a reality.

Changelog

Full Changelog: v0.22.0...v0.22.1


The Charm logo

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

v0.22.0

27 Jun 20:05
ca32c4c
Compare
Choose a tag to compare

Unmanaged Output

Now you can print unmanaged output above your inline applications. This means you can print stuff above your app that won't be cleared on the next render. Itโ€™s super useful for cases where you want to build an apt-like package manager.

Letโ€™s Print

This release introduces two new Cmds that print output above your inline Bubble Tea program:

tea.Println("Hello, Bubble Tea")
tea.Printf("%s, %s", "Hello", "Bubble Tea")

Use it anytime you want to add log-type info to the terminalโ€™s scrollback buffer, such as building your own package manager ๐Ÿ“ฆ. And keep in mind that these methods are no-opโ€™s in altscreen mode.

Package Manager Demo

For details see the full example and the docs.

๐Ÿค— Thanks

@fiws has been bugging us to implement this forever and then @Adjective-Object swooped in and did it with style and grace! Itโ€™s been a great collaboration all around.


Changelog

New

Fixed!

  • Race condition on repaint by @georgijd in #330
  • Handle batched key msgs by @muesli in #326

New Contributors

Full Changelog: v0.21.0...v0.22.0


The Charm logo

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

v0.21.0

02 Jun 00:34
775dbfb
Compare
Choose a tag to compare

Spawn Interactive Processes + More Keybindings

Finally! This update allows you to run blocking, interactive processes from Bubble Tea like vim, htop, curl, and even entire shells like fish. It also adds a bunch of new keybindings. Read on for more!

Letโ€™s Exec

As we were saying, you can now spawn interactive processes in the terminal from Bubble Tea and resume Bubble Tea when they exit. For example, you could have your Bubble Tea program spawn vim to edit a file, or temporarily open a shell, like fish. Hereโ€™s what it looks like:

type editorFinishedMsg struct{ err error }

func openInVim(path string) tea.Cmd {
	c := exec.Command("vim", path)
	return tea.ExecProcess(c, func(err error) tea.Msg {
		return editorFinishedMsg{err}
	})
}

See the full example for details.

Keys Galore

Prior to this update, you couldn't bind to the functions keys. Isn't that crazy? @mrusme certainly thought so. With this update you can can now respond to F1 through F20, modifiers included.

And thanks to @Bwahharharrr you can also now bind to arrow keys with the ctrl, shift and alt modifiers.


High-Level Changelog

New

  • move cancelreader into a separate package by @muesli in #222
  • Exec, program.ReleaseTerminal and RestoreTerminal to re-use input and terminal by @muesli in #237
  • add support for shift/ctrl + arrow keys by @meowgorithm in #292
  • add function key support by @meowgorithm in #263

Changed

New Contributors

Full Changelog: v0.20.0...v0.21.0


The Charm logo

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

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