[GH-ISSUE #15692] cmd/tui: upgrade bubbletea / lipgloss to v2? #72068

Open
opened 2026-05-05 03:24:58 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @mverrilli on GitHub (Apr 19, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15692

Is a PR to migrate cmd/tui from bubbletea/lipgloss v1 to v2 wanted?

Motivation

v2 removes the package-level init() in bubbletea that calls lipgloss.HasDarkBackground(). That init is the source of #15597 (5s OSC 11 timeout on ollama ls in a PTY) — it fires on every invocation because bubbletea is in the binary's import graph. No in-module workaround can run before it, since Go orders independent-package inits alphabetically by import path and github.com/ollama/... sorts after github.com/charmbracelet/.... Separately, v1 is now frozen.

Scope

~8 files in cmd/tui/, roughly 300–500 line diff. The ollama TUI uses a narrow subset of the APIs — no mouse, paste, alt-screen, program options, or removed commands are touched. Breaking changes that apply:

  • Import paths → charm.land/bubbletea/v2, charm.land/lipgloss/v2
  • View() stringView() tea.View
  • tea.KeyMsg (struct) → tea.KeyPressMsg; msg.Typemsg.Code; msg.Runesmsg.Text
  • lipgloss.AdaptiveColor{…}compat.AdaptiveColor{Light: lipgloss.Color(…), Dark: lipgloss.Color(…)}
  • Tests using tea.KeyMsg{…} literals need the new field names

Considerations

  • New vanity domain charm.land/ replaces github.com/charmbracelet/….
  • bubbletea v2.0.0 shipped in Feb 2026; current patch is v2.0.6.
  • compat.AdaptiveColor is a shim; a follow-up could move to the idiomatic lipgloss.LightDark helper.
  • Interactive flows (launcher menu, signin, selector, confirm) need manual verification — not cleanly unit-testable.

Happy to send the PR. If a v2 migration is already planned or in flight, let me know and I'll close this out.

Originally created by @mverrilli on GitHub (Apr 19, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15692 Is a PR to migrate `cmd/tui` from bubbletea/lipgloss v1 to v2 wanted? ## Motivation v2 removes the package-level `init()` in bubbletea that calls `lipgloss.HasDarkBackground()`. That init is the source of #15597 (5s OSC 11 timeout on `ollama ls` in a PTY) — it fires on every invocation because bubbletea is in the binary's import graph. No in-module workaround can run before it, since Go orders independent-package inits alphabetically by import path and `github.com/ollama/...` sorts after `github.com/charmbracelet/...`. Separately, v1 is now frozen. ## Scope ~8 files in `cmd/tui/`, roughly 300–500 line diff. The ollama TUI uses a narrow subset of the APIs — no mouse, paste, alt-screen, program options, or removed commands are touched. Breaking changes that apply: - Import paths → `charm.land/bubbletea/v2`, `charm.land/lipgloss/v2` - `View() string` → `View() tea.View` - `tea.KeyMsg` (struct) → `tea.KeyPressMsg`; `msg.Type` → `msg.Code`; `msg.Runes` → `msg.Text` - `lipgloss.AdaptiveColor{…}` → `compat.AdaptiveColor{Light: lipgloss.Color(…), Dark: lipgloss.Color(…)}` - Tests using `tea.KeyMsg{…}` literals need the new field names ## Considerations - New vanity domain `charm.land/` replaces `github.com/charmbracelet/…`. - bubbletea v2.0.0 shipped in Feb 2026; current patch is v2.0.6. - `compat.AdaptiveColor` is a shim; a follow-up could move to the idiomatic `lipgloss.LightDark` helper. - Interactive flows (launcher menu, signin, selector, confirm) need manual verification — not cleanly unit-testable. Happy to send the PR. If a v2 migration is already planned or in flight, let me know and I'll close this out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#72068