Repository navigation
✨ Highlights
Follow the terminal's theme
The new opt-in sources module reads the colors from the user's terminal config, so an
app can match the terminal it's running in, and stay in sync as the user changes themes.
It supports kitty, Ghostty, Alacritty, foot, Windows Terminal, Xresources, and
.itermcolors files, and terminal.Detect picks the right one from the environment:
import (
"github.com/lrstanley/bubbletint/sources/v2/terminal"
tint "github.com/lrstanley/bubbletint/v2"
)
src, err := terminal.Detect() // The source for the terminal we're running in.
if err == nil {
detach, err := tint.Attach(ctx, src)
// [...]
}The terminal's tint is registered as e.g. kitty:current, and becomes the current tint
(use tint.WithFollow(false) to only register it). Sources live in their own module, so
the core stays free of dependencies. See
Follow the terminal's theme,
and the follow-terminal example.
React to registry changes
Subscribe calls a function whenever a registry changes: a tint being added, updated or
removed, or the current tint changing. Listen for CurrentChanged to know when to rebuild
your styles:
cancel := tint.Subscribe(func(ev tint.Event) {
if ev.Kind == tint.CurrentChanged {
p.Send(rebuildStylesMsg{}) // Forward it to your Bubble Tea program.
}
})
defer cancel()Behavior changes
- Unregistering the current tint now selects the next tint by sorted ID (or the previous
one), instead of leaving the registry pointing at a tint that's gone. - When no tint is selected,
Current()now selects the first registered tint and returns
it. Before, it could panic, or returnnilif the selected tint had been unregistered.
Changelog
✨ New Features
- 12a08f1: add tint events, source attach, and terminal theme sources (@lrstanley)
🐞 Bug Fixes
- 72a5578: misc release tagging fixes (@lrstanley)
🧹 Misc
2 changes
- c4bf478: replace Makefile with Taskfile (@lrstanley)
- 555725c: ghostty: ignore installed Ghostty themes in the built-in fallback test (@lrstanley)
📦 Dependency Updates
2 changes
- 9120cd7: deps: update iterm-schemes from release-20261012-151317-d3e95e4 to release-20261019-151001-86a776d (#34) (@lrstanley)
- 5d56884: deps: update iterm-schemes from release-20261019-151001-86a776d to release-20261116-150709-494b809 (#36) (@lrstanley)
Full changelog: v2.0.4...v2.1.0
📦 Install
go get github.com/lrstanley/bubbletint/chromatint/v2@v2.1.0
go get github.com/lrstanley/bubbletint/glamourtint/v2@v2.1.0
go get github.com/lrstanley/bubbletint/sources/v2@v2.1.0
go get github.com/lrstanley/bubbletint/v2@v2.1.0Docs:
- github.com/lrstanley/bubbletint/chromatint/v2
- github.com/lrstanley/bubbletint/glamourtint/v2
- github.com/lrstanley/bubbletint/sources/v2
- github.com/lrstanley/bubbletint/v2
💬 What to do next?
- 🙋♂️ Running into an issue or want a specific feature? Take a look here!
- ⌚ Find previous releases.
- 🗝️ Find a vulnerability? Check out our Security and Disclosure policy.
- 🔗 Other useful links: