Repository navigation
Conversation
|
| github.com/charmbracelet/bubbles/v2 v2.1.1 | ||
| github.com/charmbracelet/bubbletea/v2 v2.0.8 | ||
| github.com/charmbracelet/glamour/v2 v2.0.1 | ||
| github.com/charmbracelet/huh/v2 v2.0.3 | ||
| github.com/charmbracelet/lipgloss/v2 v2.0.5 |
There was a problem hiding this comment.
🚨 Bug: go.mod bumped to charmbracelet v2 but code still imports v1
go.mod was updated to require the v2 module paths (bubbles/v2, bubbletea/v2, glamour/v2, huh/v2, lipgloss/v2) and the v1 requires were dropped, but all ~127 Go source files still import the v1 paths (e.g. tea "github.com/charmbracelet/bubbletea", github.com/charmbracelet/huh, github.com/charmbracelet/lipgloss). No file imports the /v2 paths. This guarantees a build failure: the v1 imports have no corresponding require, and go mod tidy would re-add v1 rather than adopt v2. Beyond imports, v2 is a breaking major release (Init signature, getter/setter fields, functional-option constructors, DefaultKeyMap now functions, lipgloss purity/AdaptiveColor removal, tea.View return type, split key/mouse messages), so the source must be migrated per the upgrade guides. Either revert this dependency bump or migrate every import path and adapt to the v2 APIs in the same PR.
Was this helpful? React with 👍 / 👎
1e461de to
639da65
Compare
Code Review 🚫 Blocked 0 resolved / 1 findingsUpdates Go dependencies to major version 2 across charmbracelet packages, but the source code still imports v1, causing compilation errors. 🚨 Bug: go.mod bumped to charmbracelet v2 but code still imports v1go.mod was updated to require the v2 module paths (bubbles/v2, bubbletea/v2, glamour/v2, huh/v2, lipgloss/v2) and the v1 requires were dropped, but all ~127 Go source files still import the v1 paths (e.g. 🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 3 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
639da65 to
554f065
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to This change currently references invalid module paths for the v2 dependencies, which can prevent the project from resolving or building its dependencies. Merge should wait until the requirements and source imports use the declared paths. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@go.mod`:
- Around line 14-18: Update the Charm v2 requirements in go.mod from
github.com/charmbracelet/.../v2 to their declared charm.land/.../v2 module
paths, and migrate all Go imports accordingly, including those in
validate_model.go and select.go. Then adapt the affected code to the breaking v2
APIs and ensure no v1 Charm imports or github.com Charm v2 requirements remain;
otherwise revert the dependency-only bump.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| github.com/charmbracelet/bubbles/v2 v2.1.1 | ||
| github.com/charmbracelet/bubbletea/v2 v2.0.8 | ||
| github.com/charmbracelet/glamour/v2 v2.0.1 | ||
| github.com/charmbracelet/huh/v2 v2.0.3 | ||
| github.com/charmbracelet/lipgloss/v2 v2.0.5 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
Use the declared Charm v2 module paths and migrate imports in the same change.
go.mod requires github.com/charmbracelet/.../v2, but the Renovate failure reports that these modules declare charm.land/.../v2. This makes the dependency graph invalid. tui/validateui/validate_model.go Lines 9-13 and ui/select.go Lines 3-7 still import v1 paths, so the repository also remains on v1 APIs.
Change the requirements and all imports to the declared charm.land/.../v2 paths, then migrate the breaking v2 APIs. Otherwise, revert this dependency-only bump.
Verification
#!/bin/bash
set -euo pipefail
# Expect no v1 Charm imports.
if rg -n '"github\.com/charmbracelet/(bubbles|bubbletea|glamour|huh|lipgloss)(/|")' --glob '*.go' .; then
echo "Found v1 Charm imports" >&2
exit 1
fi
# Expect no github.com v2 requirements.
if rg -n 'github\.com/charmbracelet/(bubbles|bubbletea|glamour|huh|lipgloss)/v2' go.mod; then
echo "Found invalid github.com Charm v2 requirements" >&2
exit 1
fi
rg -n 'charm\.land/(bubbles|bubbletea|glamour|huh|lipgloss)/v2' go.mod🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@go.mod` around lines 14 - 18, Update the Charm v2 requirements in go.mod from
github.com/charmbracelet/.../v2 to their declared charm.land/.../v2 module
paths, and migrate all Go imports accordingly, including those in
validate_model.go and select.go. Then adapt the affected code to the breaking v2
APIs and ensure no v1 Charm imports or github.com Charm v2 requirements remain;
otherwise revert the dependency-only bump.
dbde342 to
8bce4d7
Compare
0c95868 to
562f321
Compare
49884b2 to
8b9ab01
Compare
b120bd7 to
2ae2c3b
Compare
547f871 to
f2d6c19
Compare
9eda3ad to
e58c7ea
Compare
f645d4f to
69f101d
Compare
69f101d to
c9afa02
Compare
This PR contains the following updates:
v0.21.1->v2.2.1v1.3.10->v2.1.0v1.0.0->v2.0.1v0.8.0->v2.0.3v1.1.1-0.20250404203927-76690c660834->v2.0.6Release Notes
charmbracelet/bubbles (github.com/charmbracelet/bubbles)
v2.2.1Compare Source
Tiny Monday bugfix
Textarea element had a bug, where you used to be able to go 1 word backwards, even if there was nothing, which resulted in the whole TUI freezing. It was now fixed by @OxQuasar!
Changelog
Fixed
f613411: fix(textarea): stop word-left at input boundary (#1036) (@OxQuasar)Docs
87d4458: docs: update godoc link in readme to new package (@meowgorithm)Other stuff
10489b5: readme: drop tree section for now (@meowgorithm)4909481: v2.2.1 (@andrinoff)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.2.0Compare Source
A new Bubble and some new Textarea stuff
There are a couple nice features in today's release. Let's check em out!
If a tree falls in the forest…
At last, the tree Bubble from all star contributor @dlvhdr’s is here! He built it for DiffNav and graciously contributed to Bubbles. We've been working with Dolev for a long time and were totally stoked when he offerd to contribute.
Select all, ctrl+c, ctrl+v…done!
Our own @andrinoff added a bunch of awesome stuff to Textarea, including the long awaited text selection. Select, copy, and cut your way into mini text editing.
For more info see the docs.
And special thanks to @zoriya for adding ctrl+left/right bindings.
xoxo,
Charm! 💌
Changelog
New!
8cea431: feat(textarea): support ctrl + left/right/backspace (#1020) (@zoriya)037ad37: feat: textarea selection (#1029) (@andrinoff)e97af08: feat: tree bubble (#893) (@dlvhdr)Fixed
6484e49: fix(filepicker): don't blank the view when height is unset (#1026) (@andrinoff)Other stuff
355f960: ci: sync dependabot config (#896) (@charmcli)ef8af03: 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.1Compare Source
Lil’ Textarea Fix
This is a tiny patch to fix a bug in
textareawhere the prompt character could be missing styling on empty lines. That’s all for now!Thanks for using Bubbles,
Charm 🌞
Changelog
Fixed
d2b2217: fix(textarea): apply prompt style on all lines, including fillers (@meowgorithm)Docs
a13f110: docs: fix typo in README (#921) (@Rohan5commit)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.0Compare Source
Shrink ’n’ grow your textareas
The update adds a new feature to automatically resize your
textareavertically as its content changes.Piece of cake, right?
Enjoy! 💘
Changelog
New!
f1daacf: feat(textarea): dynamic height (#910) (@meowgorithm)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.0Compare Source
Bubbles v2 is here! 🫧
We're thrilled to share Bubbles v2 with you! This release accompanies Bubble Tea v2 and Lip Gloss v2 and brings a ton of consistency, new features, and quality-of-life improvements across every component. Catch 'em all:
You can also check the Upgrade Guide for more info.
There are a lot of changes in here, but we've found upgrading pretty easy, especially with a linter. Read on for the full breakdown!
🏠 New Home
Bubbles v2 now lives at
charm.land:All sub-packages follow the same pattern:
charm.land/bubbles/v2/viewport,charm.land/bubbles/v2/list, etc.🎨 Light and Dark Styles
Some Bubbles, like
help, offer default styles for both light and dark backgrounds. Since Lip Gloss v2 removesAdaptiveColor, choosing light or dark is now a manual process. You've got a couple of options.🎩 The Best Way
Have Bubble Tea query the background color for you. This properly queries the correct inputs and outputs, and happens in lockstep with your application:
If you're using Wish you must do it this way to get the background color of the client.
🤠 The Quick Way
Use the
compatpackage in Lip Gloss. It's less recommended because it contains blocking I/O that operates independently of Bubble Tea, and when used with Wish it won't detect the client's background:👀 Or Just Pick One
This pattern applies to
help,list,textarea, andtextinput.🔑 The Init You Know and Love is Back
After experimenting with a few different forms of
Initduring the alphas, we decided the v1 signature was the right call after all.Initwas a bit too redundant for our tastes given that initialization already happens inNew:✨ The Big Highlights
Getters and Setters Everywhere
All components now use getter/setter methods instead of exported
WidthandHeightfields. This lets us do internal bookkeeping when things change, and it makes the API consistent across every Bubble:Affected:
filepicker,help,progress,table,textinput,viewport.Functional Options
Constructors now use the functional options pattern instead of positional args or separate constructor functions:
DefaultKeyMap is a Function Now
All
DefaultKeyMappackage-level variables are now functions, so you get fresh values every time:Real Cursor Support 🖱️
Both
textareaandtextinputnow support real terminal cursors! The feature is opt-in, so by default your programs will continue to use the easy-breezy virtual cursor. SetVirtualCursortofalseand useModel.Cursor()for the real deal. Check out the textarea and textinput examples to see it in action.Cleaned House 🧹
All previously deprecated symbols have been removed:
NewModelvariants — just useNewspinner.Tick()— useModel.Tick()insteadpaginator.UsePgUpPgDownKeysand friends — customizeKeyMapdirectlyfilepicker.DefaultStylesWithRenderer()— Lip Gloss is pure now, useDefaultStyles()viewport.HighPerformanceRendering— no longer neededruneutilandmemoizationpackages moved tointernal/(they were never meant for public use anyway)What's Changed: the Laundry List
🔮 Cursor
Model.Blinkrenamed toModel.IsBlinkedfor clarityModel.BlinkCmd()renamed toModel.Blink()📂 Filepicker
DefaultStylesWithRenderer()removed — Lip Gloss is pure now, so just useDefaultStyles()Model.Heightbroken intoSetHeight(int)/Height() int❓ Help
Model.Widthbroken intoSetWidth(int)/Width() intDefaultStyles(isDark bool),DefaultDarkStyles(), andDefaultLightStyles()🥕 List
DefaultStyles()andNewDefaultItemStyles()now take anisDark boolparameterStyles.FilterPromptandStyles.FilterCursorhave been consolidated intoStyles.Filter(atextinput.Styles)GlobalIndexhelper added📄 Paginator
DefaultKeyMapvariable →DefaultKeyMap()functionUsePgUpPgDownKeys,UseLeftRightKeys, etc.) removed — customizeKeyMapdirectly🌈 Progress
This one got the biggest makeover!
WithGradient/WithScaledGradient→WithColors(...color.Color)— pass 2+ colors for blendingWithSolidFill(string)→WithColors(color)— pass a single color for a solid fillWithDefaultGradient()→WithDefaultBlend()WithScaled(bool)to scale the blend to fit only the filled portionWithColorFunc(func(total, current float64) color.Color)for fully dynamic coloringWithColorProfileremoved — Bubble Tea handles this automatically nowModel.FullColorandModel.EmptyColorchanged fromstringtoimage/color.ColorModel.Widthbroken intoSetWidth(int)/Width() intModel.Updatenow returnsModelinstead oftea.Model🌀 Spinner
Tick()package-level function removed — useModel.Tick()instead⏱️ Stopwatch
NewWithInterval(d)removed — useNew(WithInterval(d))instead🔢 Table
Model.Width/Model.Heightreplaced with getter/setter methodsansi.Truncateinstead ofrunewidth.Truncate✏️ Textarea
The big change here is real cursor support — but that's opt-in, so by default your programs will keep using the virtual cursor.
DefaultKeyMapvariable →DefaultKeyMap()functionPageUp/PageDownkey bindingsModel.FocusedStyle/Model.BlurredStyle→Model.Styles.Focused/Model.Styles.BlurredStyletype renamed toStyleState; newStylesstruct groupsFocused,Blurred, andCursorModel.SetCursorrenamed toModel.SetCursorColumnModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursorbool added — set tofalsewhen using a real cursorDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()Column(),ScrollYOffset(),ScrollPosition(),MoveToBeginning(),MoveToEnd()SetPromptFunc📜 Textinput
Most of the changes here bring
textinputto parity withtextarea, including real cursor support. Styling has been consolidated into aStylesstruct withFocusedandBlurredstates:DefaultKeyMapvariable →DefaultKeyMap()functionModel.Widthbroken intoSetWidth(int)/Width() intModel.PromptStyle→StyleState.PromptModel.TextStyle→StyleState.TextModel.PlaceholderStyle→StyleState.PlaceholderModel.CompletionStyle→StyleState.SuggestionModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursor()/SetVirtualCursor(bool)addedModel.Styles()/SetStyles(Styles)addedDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()⏲️ Timer
NewWithInterval(timeout, interval)removed — useNew(timeout, WithInterval(interval))📦 Viewport
viewportgot a ton of love in v2. Let's dive in!Breaking changes:
New(width, height int)→New(...Option)withWithWidth/WithHeightModel.Width,Model.Height,Model.YOffsetreplaced with getter/setter methodsHighPerformanceRenderingremovedShiny new features:
You can now scroll horizontally with the left and right arrow keys, and set up a custom gutter column for things like line numbers:
Highlight parts of what's being viewed with regex:
Let viewport handle soft wrapping for you:
Or, if you need fine control, use
SetContentLineswith "virtual lines" containing\n— they're treated as soft wraps automatically.Also new:
GetContent()to retrieve contentFillHeightto pad the viewport with empty linesStyleLineFuncfor per-line stylingHighlightStyleandSelectedHighlightStylefor highlight appearanceChangelog
Fixed
ansi.Truncateinstead ofrunewidth.Truncate(#884) (@jedevc)Docs
Other stuff
💝 That's a wrap!
Feel free to reach out, ask questions, give feedback, and let us know how it's going. We'd love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
v1.0.0Compare Source
This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧
Changelog
Fixed
d016636: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#881) (@Atennop1)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
charmbracelet/bubbletea (github.com/charmbracelet/bubbletea)
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 charmbracelet/bubbletea@fdcd0cf and https://github.com/charmbracelet/ultraviolet/pull/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 charmbracelet/bubbletea@1ed724a and charmbracelet/ultraviolet@b516641 for 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 charmbracelet/bubbletea@c788fe9 and charmbracelet/x@6921c75 for 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
Configuration
📅 Schedule: Branch creation - "before 6am on monday" in timezone Etc/UTC, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot.