Skip to content

Releases: charmbracelet/bubbletea

v0.12.4

18 Jan 17:25
Compare
Choose a tag to compare

This mini-release adds the tea.Sequentially helper command, which is useful for executing several commands in order. For example, maybe you want to save and quit, but only if the save was successful:

func saveStateCmd() Msg {
	if err := save(); err != nil {
 		return errMsg{err}
 	}
	return nil
}

cmd := Sequentially(saveStateCmd, Quit)

For details, see the docs.


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

The Charm logo

v0.12.3

15 Jan 18:03
e9efdf8
Compare
Choose a tag to compare

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.

v0.12.2

02 Nov 15:07
Compare
Choose a tag to compare

This release adds support for multi-character input, most notably Chinese and Japanese IME. Adding this support required some API changes:

  • Key.Rune is now Key.Runes
  • Type KeyRune is now KeyRunes
  • Key.IsRune() was removed. To determine if input is a string (or []rune) use Key.Type == KeyRunes

v0.12.1

22 Oct 19:30
a1d92e7
Compare
Choose a tag to compare

Correct backspace and delete key bindings.