github charmbracelet/bubbletea v0.12.3

latest releases: v2.0.0-alpha.2, v1.2.2, v1.2.1...
3 years ago

This release contains some small but powerful improvements to make Bubble Tea more flexible and more foolproof.

Improved Rendering

Lines wider than the window width are now automatically trimmed to prevent line wrapping which previously messed up rendering a little. Note that this is for unix systems only: Windows is not able to determine terminal width, so Bubble Tea wouldn't know where to truncate lines.

Do note that for more precise control you can also truncate long lines yourself. We recommend the truncate package in @muesli’s excellent Reflow project which Bubble Tea is using internally to trim lines.

Custom Input and Output

Input and output can now be set to any valid io.Reader and io.Writer (by default they're os.Stdin and os.Stdout, respectively). Additionally, if input’s not a TTY the runtime will simply stop listening for input (previously, Bubble Tea would exit with error).

SIGINT

Bubble Tea now exits gracefully when it receives a SIGINT. In most casts ctrl-c still won’t send an interrupt because those keys are sent through to Bubble Tea so you can map them as you'd like. If input’s not a TTY, however, ctrl-c will generally send an in interrupt and Bubble Tea will restore the terminal and quit.


Thoughts? Questions? Feel free to reach out on Twitter and The Fediverse.

Don't miss a new bubbletea release

NewReleases is sending notifications on new releases.