fix(deps): update module github.com/charmbracelet/bubbletea to v2 #9
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/github.com-charmbracelet-bubbletea-2.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
v1.3.10→v2.2.0Release Notes
charmbracelet/bubbletea (github.com/charmbracelet/bubbletea)
v2.2.0Compare Source
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
ProgramResumeon your view with the command that restarts your program, and optionally the folder to run it in: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 atea.EnvMsgat startup, so check for it there:You only need the
tea.EnvMsgcheck 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.3Compare Source
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.2Compare Source
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:
BatchorSequencepanicsRunreturns early with an errorRestoreTerminalswaps the input readerRunfinishes and the TTY files it opened for input need closingAnd 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
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.1Compare Source
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.0Compare Source
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
33f6a40: docs: fix command and environment godoc examples (#1833) (@GreedyC)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.10Compare Source
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.9Compare Source
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.8Compare Source
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 improvementsThoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.7Compare Source
A few lil’ stability patches
Hi! This is a patch release with a few solid improvements around stability and correctness.
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.6Compare Source
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
fdcd0cfand 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.
v2.0.5Compare Source
A small release to remove accidental unwanted debug log file. See
1ed724aand charmbracelet/ultraviolet@b516641for details.Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.4Compare Source
This release includes a small fix related to width calculation in x/ansi. See
c788fe9and charmbracelet/x@6921c75for more details.Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.3Compare Source
Extra Extra Extended Keyboard Enhancements!
This release adds support for the full set of Keyboard Enhancements. Now you can enable any enhancements on top of the default disambiguate one.
Smarter Renderer
We also fixed a few renderer related bugs and made the Cursed Renderer smarter. Now, we always reset the terminal tab stops for the Bubble Tea program process context. People using
tabs -Nin their shell profiles shouldn't be affected.See the full changelog below.
Changelog
New!
05df5ae: feat: support extended keyboard enhancements (#1626) (@aymanbagabas)Fixed
a3d7807: fix(ci): only run build-examples on non-dependabot PRs (@aymanbagabas)7df1e65: fix(examples): migrate imports to charm.land for the glamour example (#1642) (@mhdna)ee06e98: fix(examples): resolve nil pointer dereference (#1663) (@mattpcaswell)ac355fe: fix(renderer): restore tab stops if hard tabs are enabled (#1677) (@aymanbagabas)729f05c: fix: add missing signal.Stop in suspendProcess to prevent signal channel leak (Closes #1673) (#1674) (@kuishou68)Docs
bbe4faf: docs(example): add textarea dynamic height example (#1639) (@meowgorithm)e19d255: docs: fix README wording (#1624) (@Rohan5commit)Other stuff
65c3978: ci: sync golangci-lint config (#1556) (@github-actions[bot])Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.2Compare Source
This release contains a small patch fixing a rendering that might affect Wish users running on Unix platforms.
Changelog
Fixed
f25595a: fix(renderer): use mapNl optimization when not on Windows and no PTY input (#1615) (@aymanbagabas)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.1Compare Source
A small patch release to fix opening the proper default stdin file for input.
Changelog
Fixed
110a919: fix(examples): add missingWithWidthto table example (#1598) (@shv-ng)66b7abd: fix: check if os.Stdin is a terminal before opening the TTY (@aymanbagabas)Docs
c751374: docs: correct whats new link (@aymanbagabas)736fba2: docs: upgrade guide: correct badge url (@aymanbagabas)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.0Compare Source
What's New in Bubble Tea v2
We're very excited to announce the second major release of Bubble Tea!
If you (or your LLM) are just looking for technical details on on migrating from v1, please check out the Upgrade Guide.
❤️ Charm Land Import Path
We've updated our import paths to use vanity domains and use our domain to import Go packages.
Everything else stays the same 🙂
👾 The Cursed Renderer
Bubble Tea v2 ships with the all-new Cursed Renderer which was built from the ground up. It's based on the ncurses rendering algorithm and is highly optimized for speed, efficiency, and accuracy and is built on an enormous amount of research and development.
Optimized renders also means that Wish users get big performance benefits and lower bandwidth usage by orders of magnitude.
To take advantage of the new Cursed Renderer you don't need to do anything at all except keep on using the Bubble Tea you know and love.
✌️ Key handling is way better now
Newer terminals can now take advantage of all sorts keyboard input via progressive keyboard enhancements. You can now map all sorts of keys and modifiers like shift+enter and super+space. You can also detect key releases (we're looking at you, game developers).
It's easy to detect support for supporting terminals and add fallbacks for those that don't. For details, see keyboard enhancements below.
🥊 No more fighting
In the past, Bubble Tea and Lip Gloss would often fight over i/o. Bubble Tea wanted to read keyboard input and Lip Gloss wanted to query for the background color. This means that things could get messy. Not anymore! In v2, Lip Gloss is now pure, which means, Bubble Tea manages i/o and gives orders to Lip Gloss. In short, we only need one lib to call the shots, and in the context of this relationship, that lib is Bubble Tea.
But what about color downsampling? That's a great question.
👨🏻🎨 Built-in Color Downsampling
We sneakily released a little library called colorprofile that will detect the terminal's color profile and auto-downsample any ANSI styling that flows through it to the best available color profile. This means that color will "just work" (and not misbehave) no matter where the ANSI styling comes from.
Downsampling is built-into Bubble Tea and is automatically enabled.
🧘 Declarative, Not Imperative
This is a big one. In v1, you'd toggle terminal features on and off with commands like
tea.EnterAltScreen,tea.EnableMouseCellMotion,tea.EnableReportFocus, and so on. In v2, all of that is gone and replaced by fields on theViewstruct. You just declare what you want your view to look like and Bubble Tea takes care of the rest.This means no more fighting over startup options and commands. Just set the fields and forget about it. For example, to enter full screen mode:
The same goes for mouse mode, bracketed paste, focus reporting, window title, keyboard enhancements, and more. See A Declarative View below for the full picture.
Keyboard Enhancements
Progressive keyboard enhancements allow you to receive key events not normally possible in traditional terminals. For example, you can now listen for the ctrl+m key, as well as previously unavailable key combinations like shift+enter.
Bubble Tea v2 will always try to enable basic keyboard enhancements that disambiguate keys. If your terminal supports it, your program will receive a
tea.KeyboardEnhancementsMsgmessage that indicates support for requested features.Historically, certain key combinations in terminals map to control codes. For example, ctrl+h outputs a backspace by default, which means you can't normally bind a key event to ctrl+h. With key disambiguation, you can now actually bind events to those key combinations.
You can detect if a terminal supports keyboard enhancements by listening for
tea.KeyboardEnhancementsMsg.Which terminals support progressive enhancement?
Key Messages
Key messages are now split into
tea.KeyPressMsgandtea.KeyReleaseMsg. Usetea.KeyMsgto match against both. We've also replacedkey.Typeandkey.Runeswithkey.Codeandkey.Text. Modifiers live inkey.Modnow instead of being separate booleans. Oh, and space bar returns"space"instead of" ".The easiest way to match against key press events is to use
msg.String():The
Keystruct also has some nice new fields:key.BaseCode— the key according to a standard US PC-101 layout. Handy for international keyboards where the physical key might differ.key.IsRepeat— tells you if the key is being held down and auto-repeating. Only available with the Kitty Keyboard Protocol or Windows Console API.key.Keystroke()— a new method that returns the keystroke representation (e.g.,"ctrl+shift+alt+a"). UnlikeString(), it always includes modifier info.For the full list of changes and before/after code samples, see the Upgrade Guide.
Paste Messages
Paste events used to arrive as
tea.KeyMsgwith a confusingmsg.Pasteflag. Now they're their own thing:Mouse Messages
We've improved the mouse API. Mouse messages are now split into
tea.MouseClickMsg,tea.MouseReleaseMsg,tea.MouseWheelMsg, andtea.MouseMotionMsg. And mouse mode is set declaratively in yourView():A Declarative View
In v1,
View()returned astring. In v2, it returns atea.Viewstruct that lets you declare everything about your view — content, cursor, alt screen, mouse mode, colors, window title, progress bar, and more:No more fighting over options and commands! Just set the fields:
An Actual Cursor
You can now control the cursor position, color, and shape right from your view function. Want it hidden? Just set
view.Cursor = nil.You can also use
tea.NewCursor(x, y)for a quick block cursor with default settings.Progress Bar Support
Now you can ask Bubble Tea to render a native progress bar for your application. Just set the
view.ProgressBarfield and Bubble Tea will take care of the rest.Synchronized Updates (Mode 2026)
Bubble Tea will try and use mode 2026 to push updates to the terminal. This mode helps reduce tearing and cursor flickering by atomically updating the terminal window once all the update sequences are pushed out and read by the terminal. This is enabled by default and there's nothing you need to do.
Better Terminal Unicode Support (mode 2027)
Now Bubble Tea will automatically enable mode 2027
on terminals that support it. This mode allows the terminal to properly handle wide Unicode
characters and emojis without breaking the layout of your app. Again, this is
enabled by default and there's nothing you need to do.
Native Clipboard Support
Bubble Tea now supports native clipboard operations, also known as OSC52. This means you can even copy and paste over SSH!
X11 and Wayland users can also use
tea.SetPrimaryClipboardto set the primary clipboard. Note that this is a very niche sort of thing and may or may not work on macOS, Windows, and other platforms without the notion of more than one clipboard.Terminal Colors
You can now read and set the terminal's foreground, background, and cursor colors. To change them, set
view.ForegroundColor,view.BackgroundColor, andview.Cursor.Colorin yourView()function.🌍 Environment Variables
Bubble Tea now sends you a
tea.EnvMsgat startup with the environment variables. This is especially handy for SSH apps whereos.Getenvwould give you the server's environment, not the client's.🔮 Raw Escape Sequences
For the power users out there, you can now send raw escape sequences directly to the terminal with
tea.Raw. This is great for querying terminal capabilities or doing things Bubble Tea doesn't have a built-in for (yet).Responses from the terminal will come back as messages in
Update. Just be sure you know what you're doing — with great power comes great terminal weirdness.📍 Cursor Position Queries
Need to know where the cursor is? Now you can ask.
📊 Terminal Mode Reports
You can query whether the terminal supports specific modes (like focus events or synchronized output) using DECRPM mode reports. Send a raw DECRQM request and listen for
tea.ModeReportMsg.Terminal Version and Name
Don't know what terminal you're running in?
$TERMis too vague? Bubble Tea now has atea.RequestTerminalVersioncommand that queries the terminal for its name and version using the XTVERSION escape sequence.Terminfo and Termcap Capabilities
Sometimes you need to know what capabilities the terminal has. Bubble Tea now has a
tea.RequestCapabilitycommand that queries the terminal for a specific terminfo/termcap capability.Detecting the Color Profile
Need to use the detected color profile in your app? Listen to
tea.ColorProfileMsginUpdate:Manually Applying a Color Profile
Want to manually set a color profile for testing? Now you can, on the program level.
Want to hard detect the color profile in Wish? We bet you do.
🪟 Window Size for Testing
When running tests or in non-interactive environments, you can now set the initial terminal size:
No more mocking terminals just to run your tests. Nice!
Use the Terminal's TTY
Sometimes your program will write to stdout while it's being piped or
redirected. In these cases, you might want to write directly to the terminal's
TTY instead of stdout because stdout might not be a terminal. Or your program
expects to read from stdin but stdin is being piped from another program.
In Bubble Tea v1, there wasn't a good way to do this. In the latter case, you
could use the
WithInputTTY()option to read from the terminal's TTY insteadof stdin. However, there was no easy way to write to the terminal's TTY instead
of stdout without fiddling with file descriptors.
In Bubble Tea v2, you can now simply use the global
OpenTTY()to open theterminal's TTY for reading and writing. You can then pass the TTY file handles
to the
WithInput()andWithOutput()options.Note that Bubble Tea v2 will always use the TTY for input when input is not specified
via
WithInput(...).Changelog
New!
Fixed
Docs
Other stuff
🌈 More on Bubble Tea v2
Ready to migrate? Head over to the Upgrade Guide for the full migration checklist.
Feedback
Have thoughts on Bubble Tea v2? We'd love to hear about it. Let us know on…
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: go.sum
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.