Repository navigation
chore: update to bubbletea v2 - #329
Conversation
amoeba
left a comment
There was a problem hiding this comment.
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.
| case tea.KeyCtrlC, tea.KeyCtrlD, tea.KeyEsc: | ||
| case tea.KeyPressMsg: | ||
| switch msg.String() { | ||
| case "ctrl+c", "ctrl+d", "esc": |
There was a problem hiding this comment.
This change in bubbletea seems unfortunate. Just noticing.
There was a problem hiding this comment.
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.
|
@amoeba updated to fix the piping output |
amoeba
left a comment
There was a problem hiding this comment.
Tested and it looks good now, thanks.
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
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