Closed twpayne closed 1 month ago
Thanks for reporting this, Tom. Agreed: Bubble Tea should not be panicking here. We'll look into it, and while it may be a bug in Bubble Tea, I do wonder if the panic is happening higher up in chezmoi. By default, Bubble Tea catches panics in Program
s so that it can disengage from the terminal and return it to a useable state.
Also note that there’s a newer version of Bubble Tea out (v0.26.2; it looks like chezmoi is on v0.25.0 per the stack trace).
Hey @twpayne; just following up on this. I do believe what we're seeing here is a panic in Chezmoi, with Bubble Tea simply recovering from the panic and restoring the terminal state. That's this item in the stack trace in Chezmoi #3758:
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:478 +0x91
panic({0x12b4ec0?, 0xc00051c060?})
Given that I'm going to close this issue, however in chance I'm wrong and you're able to reproduce the issue please do reopen this and we'll examine it further.
Ah, I'm sorry, you're totally right. Apologies for the noise.
I mistook the tea.unknownCSISequenceMsg
part as coming from bubbletea, but now I see that this is actually a message type that send to a model's Update()
method, and chezmoi's HTTP download spinner panics when it receives messages that it doesn't expect:
However, I see from charmbracelet/bubbles that unexpected messages should be ignored:
Thanks again!
Describe the bug
bubbletea panics with the message
tea.unknownCSISequenceMsg: unknown message type
occasionally. I'm unable to reproduce this, but "Effective Go" states that libraries should not panic.Setup
This was reported by users in:
To Reproduce
I am unable to reproduce it.
Source Code
See above.
Expected behavior
bubbletea should not panic, and it it does, it should include sufficient information to know what went wrong (e.g. the CIS sequence that caused the panic).
Screenshots
n/a
Additional context
Happy to help debug this!