Releases: charmbracelet/bubbletea
v1.0.0
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.
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.27.1
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
- d6458e0: fix: force query the terminal bg before running any programs (@aymanbagabas)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.27.0
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
}
// ...
}
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!
- 7d70838: feat: add a cmd to request window size (#988) (@aymanbagabas)
- ea13ffb: feat: allow to suspend bubbletea programs (#1054) (@caarlos0)
- cae9acd: feat: set the program environment variables (#1063) (@aymanbagabas)
Fixed
- 7c1bfc0: query window-size in a goroutine (#1059) (@aymanbagabas)
- 4497aa9: reset cursor position on renderer exit (#1058) (@aymanbagabas)
- d6a19f0: wrap
ErrProgramKilled
error (@aymanbagabas) - 4a9620e: fix bugs in package-manager example (@AkshayKalose)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.26.6
Changelog
Bug fixes
- 60a57ea: fix: nil deref on release terminal (@aymanbagabas)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.26.5
Fix special keys input handling on Windows using the latest Windows Console Input driver.
Changelog
New Features
- 42a7dd8: feat(ci): use goreleaser for releases (#1023) (@aymanbagabas)
Bug fixes
Other work
- 2d65ed6: chore(examples): removed use of deprecated Copy (@arianizadi)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.26.4
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
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.26.3
This is a patch release that prevents tea.WindowSizeMsg
s 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
- Prevent multiple window-size-events from firing on Windows by @aymanbagabas in #1021
- refactor: use x/term and x/ansi for renderer sequences by @aymanbagabas in #962
Full Changelog: v0.26.2...v0.26.3
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.26.2
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
- fix: stop and drain timers by @caarlos0 in #993
- chore(lint): minor lint-related improvements by @meowgorithm in #1007
- fix: renderer: reset the cursor on the first line by @aymanbagabas in #1008
- chore(deps): bump golang.org/x/sys from 0.19.0 to 0.20.0 by @dependabot in #1003
- chore(deps): bump golangci/golangci-lint-action from 5 to 6 by @dependabot in #1005
- chore(deps): bump golang.org/x/term from 0.19.0 to 0.20.0 by @dependabot in #1002
Full Changelog: v0.26.1...v0.26.2
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.26.1
This is a quick one to fix a Windows shortcoming in the last release acutely identified by our pal @jon4hz. Thank you!
What's Changed
Full Changelog: v0.26.0...v0.26.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.26.0
Bracketed Paste, Windows Improvements, Mainframes, and more
What do tapioca balls, IBM mainframes, and the Microsoft Windows Console API have in common? Bubble Tea v0.26.0, thatโs what. Letโs get to it.
โก๏ธ Windows Input Improvements
A few years ago @erikgeiser, a penetration tester and ex-particle physicist, wrote this awesome library called coninput to majorly improve Bubble Tea input on Windows. @aymanbagabas has implemented the library in Bubble Tea and input on Windows is roughly 1000 times better now. In the short term, this means that for Windows users inputting non-Latin characters (like Greek, Cyrillic, Korean, Chinese and so on) stuff will โjust work.โ
The bigger news, however, is that this paves the way for Windows parity with our forthcoming support for super high fidelity input via Kitty Keyboard and Fixterms.
๐ณ Hot Windows Resize Events
Terminal emulators on Windows donโt support the SIGWINCH
signal, which is sent when the terminal is resized. Itโs been a huge bummer for a really long time. Thanks (again) to @erikgeiser and @aymanbagabas, weโre now able to reach deep into Windowsโ underpinnings, detect window resizes, and send tea.WindowSizeMsg
s accordingly! This is a glorious moment for Bubble Tea on Windows indeed.
๐ซ Bracketed Paste
While building a query editor for a CockroachDB client, @knz noticed that Bubble Tea didn't support Bracketed Paste. Performance-wise, that sucks because it means pasting large bodies of text (like SQL queries) will normally be seen as a bunch of little successive keypresses. Thatโs where Bracketed Paste comes in. When enabled at the terminal-level Bracketed Paste lets you slam down a bunch of text with one big, fat input event.
Bubble Tea enables bracketed paste by default, however you can opt out of it with the WithoutBracketedPaste()
program option:
p := tea.NewProgram(myCuteModel, tea.WithoutBracketedPaste())
You can also enable and disable it on demand with the EnableBracketedPaste()
and DisableBracketedPaste()
commands.
๐ฟ Multiline tea.Println
In case you forgot, tea.Println
(and itโs brother tea.Printf
) is a Cmd
that lets you print unmanaged output above a Bubble Tea program, similar to what you see with package managers like apt-get
. Thanks to @Adjective-Object (who also implemented tea.Println
in the first place) now you can send multi-line output, too. For a tea.Println
refresher see the package manager example.
๐ Hello, z/OS
Donโt you think itโs about time we all ran Bubble Tea apps on our mainframes? Thanks to @dustin-ward that dream is now a reality, so long as you have a z/OS mainframe. We're thrilled to announce that Bubble Tea is now fully supported on z/OS.
๐น Bug fixes
Bugfixes are the unsung heroes that sometimes get buried below the feature listings. This release has them and theyโre good ones; see the changelog below for details.
Changelog
New!
- bracketed paste by @knz in #397
- use windows console input buffer + resize events on windows by @aymanbagabas in #878
- multiline
tea.Println()
messages by @Adjective-Object in #490 - z/OS support by @dustin-ward in #913
Changed
Fixed
- fix deadlock condition on model init panic by @eolso in #926
- reduce console/term dependencies by @aymanbagabas in #897
- optimize batches with one item by @systay in #875
New Contributors
- @kevgo made their first contribution in #893
- @canack made their first contribution in #890
- @Pheon-Dev made their first contribution in #621
- @rusinikita made their first contribution in #835
- @hedhyw made their first contribution in #864
- @mat2cc made their first contribution in #871
- @stefanlogue made their first contribution in #855
- @BigJk made their first contribution in #885
- @sharunkumar made their first contribution in #839
- @timmattison made their first contribution in #908
- @dustin-ward made their first contribution in #913
- @jaymorelli96 made their first contribution in #802
- @siddhantac made their first contribution in #906
- @taigrr made their first contribution in #853
- @systay made their first contribution in #875
- @gabe565 made their first contribution in #728
- @zMoooooritz made their first contribution in #902
- @j178 made their first contribution in #709
- @arisnacg made their first contribution in #948
- @braheezy made their first contribution in #950
- @dhth made their first contribution in #949
- @tearingItUp786 made their first contribution in #944
- @aschey made their first contribution in #597
- @petergloor made their first contribution in #955
- @kaifulee made their first contribution in #957
- @danenania made their first contribution in #971
- @cuibuwei made their first contribution in #977
- @agvxov made their first contribution in #972
- @eolso made their first contribution in #926
Full Changelog: v0.25.0...v0.25.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.