Repository navigation
Releases
v2.2.0
Resume your programs
This new protocol for Rex came out 12 hours ago andβ¦Bubble Tea supports it! βοΈ
OSC 7577: Program Resume Protocol
Bubble Tea programs can now tell the terminal how to bring them back after it restarts. Set ProgramResume on your view with the command that restarts your program, and optionally the folder to run it in:
func (m model) View() tea.View {
v := tea.NewView(m.render())
if !m.quitting {
v.ProgramResume = &tea.ProgramResume{
Args: []string{m.exe, "--session", m.sessionID},
Dir: m.dir,
}
}
return v
}Put everything the program needs to pick up where it left off in the command, like a session ID or the path to a state file.
Detecting support
Terminals that support the protocol set OSC7577_TOKEN. Bubble Tea sends you a tea.EnvMsg at startup, so check for it there:
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.EnvMsg:
m.canResume = msg.Getenv("OSC7577_TOKEN") != ""
}
return m, nil
}You only need the tea.EnvMsg check if your app should act differently depending on support, for example to show "this session will survive a restart" or to skip saving resume state.
Read the spec for all the details.
Have a nice week,
Charm β
Changelog
New!
- bb45cb6: feat: program resume protocol (OSC 7577) (#1908) (@andrinoff)
Other stuff
- f510168: v2.2.0 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.3
Another bugfix release π©Ή
A patch release full of stability fixes, mostly from our favorite contributors!
Security
Fixed a crash on malformed escape sequences. An ANSI sequence with more than 32 parameters (e.g. \x1b[1;1;1;β¦m) could panic the renderer with an index-out-of-range error. Any app that shows text it doesn't control, like logs, file contents, chat messages or LLM output, could be crashed by a single crafted line. If you render untrusted text, we recommend upgrading.
There are more fixes below ππ»
Have a nice week,
Charm β
Changelog
Fixed
- b681f23: fix(renderer): flush queued view before insert above (#1741) (@yanmxa)
- 7ab4335: fix: don't panic on uncomparable color.Color values (#1852) (@drawmeanelephant)
- 585149e: fix: drain terminal query replies before releasing the terminal (#1894) (@andrinoff)
- 7dd9c4c: fix: keep signal subscription alive through shutdown (#1853) (@drawmeanelephant)
- 9c65983: fix: return write errors from Program.Run (#1879) (@janearc)
- bc55190: fix: synchronize canceled input cleanup (#1876) (@johnnychen94)
Other stuff
- 4d61172: v2.1.3 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.2
Calmer, cooler, sturdier π§
A patch release, but it's a good one! Idle Bubble Tea programs now really sit idle, the terminal gets restored after just about anything goes wrong, and a long list of renderer bugs is gone.
Rest light!
The renderer no longer redraws when there's nothing to draw. After about half a second without changes, the frame ticker stops, and it picks right back up the moment something does change. Views that are empty or taller than the screen also skip redraws when they haven't changed.
Restoring in many more cases!
Bubble Tea now cleans up properly when:
- A command in
BatchorSequencepanics Runreturns early with an errorRestoreTerminalswaps the input readerRunfinishes and the TTY files it opened for input need closing
And when you come back from suspending a program, Unicode mode comes back with it, so wide characters and emoji line up just like before!
Smoother rendering
- Resizing the terminal no longer flashes a stale frame.
- The view's height is right from the very first frame.
- Lines printed above your view keep their exact width, and they're measured the same way as the rest of your program.
- Running a subprocess with
Execclears your view first, so it doesn't leave a ghost behind.
Big thanks to everyone who contributed to this release, and especially to the many first-time contributors! π
Read more below! ππ»
Have a nice day,
Charm XX π
Changelog
Fixed
- 9806b0c: fix(exec): clear View before releasing terminal for subprocess (#1762) (@zhaoxinyi02)
- 418cada: fix(logging): preserve Unicode prefix spacing (#1759) (@Ricardo-M-L)
- 94d45c8: fix(renderer): prevent emitting stale frame on resize (#1856) (@Guurdeep)
- 4853fda: fix(renderer): skip redraws when empty or tall views haven't changed (#1897) (@janearc)
- 6b30ecf: fix(renderer): use view height before first flush (#1766) (@fzlzjerry)
- 55ba0f6: fix: allow Program.Run to be called again after the program exits (#1890) (@simpleqt)
- 7a446b7: fix: avoid blocking prints after program exit (#1758) (@Ricardo-M-L)
- 1b8005f: fix: avoid terminal wait without input (#1829) (@lowgame)
- 13fb42d: fix: close the TTY files opened for input when Run returns (#1855) (@drawmeanelephant)
- 56a2fe7: fix: close the replaced cancel reader on RestoreTerminal (#1821) (@drmzperx)
- 18d6fa3: fix: close trace file after program run (#1844) (@lowgame)
- 5982a61: fix: data race with Kill() and Run() (#1774) (@andrinoff)
- f3d74b7: fix: ensure terminal state is restored after panics in Batch/Sequence commands (#1818) (@dajiaohuang)
- b9e7454: fix: make Quit a no-op before Run starts (#1840) (@tianrking)
- df137de: fix: measure insertAbove lines with the active width method (#1861) (@Sanjays2402)
- bd09ae6: fix: preserve exact-width lines printed above the view (#1888) (@imharjot)
- 12b7b4d: fix: restore terminal state on Run error paths (#1854) (@drawmeanelephant)
- 8675fd8: fix: restore unicode mode on resume (#1896) (@janearc)
Other stuff
- 73b79b3: Provide the platform input/signal stubs on wasip1/wasip2 (#1767) (@calvinrp)
- e4d617e: perf(renderer): stop the frame ticker while nothing changes (#1832) (@viktordanov)
- 38ddf5f: v2.1.2 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.1
Terminal size query vulnerability
This patch version fixes a vulnerability reported by @Reload3d. You can find the details of the exploit here.
Best regards,
Charm XX π«
Changelog
Fixed
- 9c6c325: fix: ingnore implausible terminal resize reports (#1887) (@andrinoff)
Other stuff
- 67b4c7a: v2.1.1 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.0
Hello OSC 7501
The exciting news in this release is support for the brand new Program Status Protocol, otherwise known as OSC 7501, released just a few days ago. The protocol is designed to allow terminal applications to report what they're doing (e.g. idle, working, waiting on the user, finished, or failed) and why.
The obvious case for the design is AI agents, but are lots of other use cases for this, and weβre excited to see what you build with it.
Itβs subtle, but hereβs Crush in Superlogicalβs Rex with the feature integrated (notice the dot in the first tab).
Bugfixes
Also, this release brings some very important fixes done by @AdamMagued, @simpleqt and @GreedyC.
Cheers!
Charm π
Changelog
New!
- 41bc626: feat: OSC 7501 (#1841) (@andrinoff)
Fixed
- 96d69d2: fix(tty): fall back to default dimensions when terminal size is 0x0 (#1836) (@AdamMagued)
- ff51ba4: fix: prevent signal goroutine deadlock on shutdown (#1806) (@simpleqt)
Docs
Other stuff
- f9df43c: v2.1.0 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.10
Change to no input programs
This is a small change to programs with no WithInput. Removed capability queries, which resulted in leaking of raw ANSI escape sequences.
Changelog
Fixed
- 8b10e22: fix: skip capability queries when input is disabled (#1801) (@drawmeanelephant)
Other stuff
- d5bfd5c: v2.0.10 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.9
Small patches π©Ή
Keybinds missing!
MouseButton11 and media record buttons were improperly handled, now fixed! (thanks to @Ricardo-M-L and @bunlongheng)
Weird UI artifacts with some terminals π½
Sometimes, when switching between tabs in your terminal for example, the screen would not clear, now fixed!
... And some small corrections to docs!
Happy coding π€
Changelog
Fixed
- dc4b017: fix(key): map media record to ultraviolet code (#1757) (@Ricardo-M-L)
- 1862dfb: fix: assign MouseButton11 = uv.MouseButton11 (#1754) (@bunlongheng)
- 930e18c: fix: don't panic in ProgressBarState.String() for out-of-range values (#1748) (@ankit090701)
- faf4dcf: fix: pendingErase in cursedRenderer (#1755) (@andrinoff)
- 0d3e281: fix: restore kitty keyboard stack on exit (#1750) (@deepakganesh78)
- 0ef9fc9: fix: typo in doc (#1756) (@andrinoff)
Docs
- d40db14: docs: fix background color detection example in doc comment (@meowgorithm)
- 882727b: docs: fix links to tutorials & examples (#1645) (@mhdna)
Other stuff
- 708ee75: ci: fix examples workflow (#1734) (@kobihikri)
- 351d215: ci: sync dependabot config (#1763) (@charmcli)
- 6fb1f47: examples/sequence: fix milisecond typo in SleepPrintln (@makoto-developer)
- 73b6d91: v2.0.9 (@andrinoff)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.8
Graphemes, schmraphemes
No terminal can render emojis perfectly, but we can try. This release improves some very specific edge cases around emoji rendering. Enjoy!
Changelog
- db569ad: fix(deps): bump ultraviolet for emoji-related rendering improvements
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.7
A few lilβ stability patches
Hi! This is a patch release with a few solid improvements around stability and correctness.
- @lrstanley, one of our faves, fixed a race condition around mice in the Cursed Renderer
- @lawrence3699 fixed a panic that could happen when input's not available
- We fixed a correctness issue with regard to mouse releases when Kitty Keyboard was active (thanks, @mitchellh)
Thanks for using Bubble Tea, and if you see anything awry please do let us know!
βCharm π
Changelog
Fixed
- c60f0c5: fix: prevent data race with cursedRenderer.onMouse (#1691) (@lrstanley)
- 074596e: fix: skip input reader restore when input is disabled (#1680) (@lawrence3699)
- 878d7df: fix(deps): bump ultraviolet for kitty keyboard fix (@meowgorithm)
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.6
This release fixes an issue with how Bubble Tea handled wide characters. Before, a wide character might be skipped or cause an infinite loop causing the CPU to spike. See fdcd0cf and charmbracelet/ultraviolet#109 for more details.
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.