Skip to content

chore: update to bubbletea v2#329

Merged
zeroshade merged 4 commits intomainfrom
upgrade-bubbletea
Mar 11, 2026
Merged

chore: update to bubbletea v2#329
zeroshade merged 4 commits intomainfrom
upgrade-bubbletea

Conversation

@zeroshade
Copy link
Copy Markdown
Member

Update to the recently released bubbletea v2 (and corresponding libs like lipgloss and such)

see https://github.com/charmbracelet/bubbletea/releases/tag/v2.0.0

Copy link
Copy Markdown
Member

@amoeba amoeba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the https://github.com/charmbracelet/bubbletea/blob/v2.0.0/UPGRADE_GUIDE_V2.md and then reviewed each file. I then went through each file the changes here look pretty safe.

This does break piping output, I think something with the new NeedsRenderer method is off. For example, when I pipe search output, I now get control codes,

$ dbc search | less
ESC[1;38;5;35mbigqueryESC[m

Other than that, this looks good to me.

Comment thread cmd/dbc/main.go
case tea.KeyCtrlC, tea.KeyCtrlD, tea.KeyEsc:
case tea.KeyPressMsg:
switch msg.String() {
case "ctrl+c", "ctrl+d", "esc":
Copy link
Copy Markdown
Member

@amoeba amoeba Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in bubbletea seems unfortunate. Just noticing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, that did annoy me a bit.

Use lipgloss.Println instead of fmt.Println for FinalOutput and
formatErr so that ANSI escape codes are automatically stripped
when stdout is not a terminal (e.g. piping to less or grep).
In lipgloss v2, Style.Render() always produces ANSI codes and
color stripping is handled by the lipgloss Writer.
@zeroshade
Copy link
Copy Markdown
Member Author

@amoeba updated to fix the piping output

Copy link
Copy Markdown
Member

@amoeba amoeba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it looks good now, thanks.

@zeroshade zeroshade merged commit 4b48932 into main Mar 11, 2026
10 checks passed
@zeroshade zeroshade deleted the upgrade-bubbletea branch March 11, 2026 16:08
zeroshade added a commit that referenced this pull request Apr 17, 2026
Update to the recently released bubbletea v2 (and corresponding libs
like lipgloss and such)

see https://github.com/charmbracelet/bubbletea/releases/tag/v2.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants