Skip to content

Releases: charmbracelet/bubbletea

v1.1.0

30 Aug 13:23
v1.1.0
e58efab
Compare
Choose a tag to compare

Letโ€™s Focus

Lose focus much? This release contains support for focus-blur window events.

Usage

All you need to do is to add the program option to your application:

p := tea.NewProgram(model{}, tea.WithReportFocus())
if _, err := p.Run(); err != nil {
	fmt.Fprintln(os.Stderr, "Oof:", err)
	os.Exit(1)
}

Then later in your Update function, you can listen for focus-blur messages:

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	switch msg := msg.(type) {
	case tea.FocusMsg:
		// Focused!
	case tea.BlurMsg:
		// Not focused :(
        }
        return m, nil
}

For details, see WithReportFocus.

Tmux

If you're using tmux, make sure you enable the focus-events option in your config.

set-option -g focus-events on

Happy focusing (whatever that means)!


The Charm logo

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

v1.0.1

29 Aug 17:48
v1.0.1
c69bd97
Compare
Choose a tag to compare

This release that fixes the way carriage returns are handled with using the WithoutRenderer ProgramOption and improves the way it works overall by not altering the terminal the way we normally do when starting a Program. For details see #1120.


The Charm logo

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

v1.0.0

28 Aug 15:06
v1.0.0
105d88a
Compare
Choose a tag to compare

At last: v1.0.0

This is an honorary release denoting that Bubble Tea is now stable. Thank you, open source community, for all your love, support, and great taste in beverage over the past four years.

Stay tuned for v2: we have some great things coming.


The Charm logo

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

v0.27.1

22 Aug 17:19
v0.27.1
17443d8
Compare
Choose a tag to compare

This is a lilโ€™ workaround for a hang that can occur when starting a program using Lip Gloss. For details see #1107.

Changelog

Bug fixes


The Charm logo

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

v0.27.0

16 Aug 16:21
v0.27.0
d6a19f0
Compare
Choose a tag to compare

Suspending, environment hacking, and more

Hi! This release has three nice little features and some bug fixes. Let's take a look:

Suspending and resuming

At last, now you can programmatically suspend and resume programs with the tea.Suspend command and handle resumes with the tea.ResumeMsg message:

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	switch msg := msg.(type) {

	// Suspend with ctrl+z!
	case tea.KeyMsg:
		switch msg.String() {
		case "ctrl+z":
			m.suspended = true
			return m, tea.Suspend
		}

	// Handle resumes
	case tea.ResumeMsg:
		m.suspended = false
		return m, nil
	}

	// ...
}

Example

There's also a tea.SuspendMsg that flows through Update on suspension.

Special thanks to @knz for prototyping the original implementation of this.

Setting the environment

When Bubble Tea is behind Wish you may have needed to pass environment variables from the remote session to the Program. Now you can with the all new tea.WithEnvironment:

var sess ssh.Session // ssh.Session is a type from the github.com/charmbracelet/ssh package
pty, _, _ := sess.Pty()
environ := append(sess.Environ(), "TERM="+pty.Term)
p := tea.NewProgram(model, tea.WithEnvironment(environ)

Requesting the window dimensions

All the Bubble Tea pros know that you get a tea.WindowSizeMsg when the Program starts and when the window resizes. Now you can just query it on demand too with the tea.WindowSize command.

Changelog

New!

Fixed


The Charm logo

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

v0.26.6

24 Jun 18:12
v0.26.6
60a57ea
Compare
Choose a tag to compare

Changelog

Bug fixes


The Charm logo

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

v0.26.5

21 Jun 01:02
v0.26.5
42a7dd8
Compare
Choose a tag to compare

Fix special keys input handling on Windows using the latest Windows Console Input driver.

Changelog

New Features

Bug fixes

Other work


The Charm logo

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

v0.26.4

30 May 18:31
eb78a8c
Compare
Choose a tag to compare

Fix panics! Using program.SetWindowTitle and others may panic if they were called before the program starts.

Also note that program.SetWindowTitle is now deprecated. To set the window title use tea.SetWindowTitle command.

What's Changed

  • chore(deps): bump github.com/charmbracelet/x/ansi from 0.1.1 to 0.1.2 by @dependabot in #1026
  • chore(deps): bump github.com/charmbracelet/lipgloss from 0.10.0 to 0.11.0 in /examples by @dependabot in #1025
  • fix: program renderer commands by @aymanbagabas in #1030

Full Changelog: v0.26.3...v0.26.4


The Charm logo

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

v0.26.3

23 May 19:20
2ac3642
Compare
Choose a tag to compare

This is a patch release that prevents tea.WindowSizeMsgs from being fired during altscreen changes on Windows. This was due to the fact that Windows emits a window-size-event on altscreen changes even if the size handโ€™t changed. Now, we cache the window-size and compare before sending the message to the Model.

What's Changed

Full Changelog: v0.26.2...v0.26.3


The Charm logo

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

v0.26.2

08 May 20:23
v0.26.2
Compare
Choose a tag to compare

This fixes a small regression that was introduced in v0.26.0 related to the first line on the first render not being displayed correctly. Thank you @mistakenelf for pointing this out in #1000!

What's Changed

Full Changelog: v0.26.1...v0.26.2


The Charm logo

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