-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
could not decode rune #668
Comments
Note: the reason we return an error here, is that this is a bit of a panic situation, as all further decodes would likely fail to. On the bright side, I believe this is already fixed by @knz and I will soon get to merge that fix. |
Hi, I encountered the same problem, here is a minimal reproduction example: package main
import (
"log"
tea "github.com/charmbracelet/bubbletea"
)
type model struct{}
func (model) Init() tea.Cmd {
return nil
}
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}
func (model) View() string {
return "hello world"
}
func main() {
p := tea.NewProgram(model{})
log.Fatal(p.Run())
} When running the program, if you paste below text to the terminal, the program will exit with "could not decode rune" error:
Actually this bug can be reproduced in any bubbletea program, if any Chinese text longer than 256 characters is pasted, the program will exit. |
Yep, this is a known issue. @muesli my PR to handle long inputs should help alleviate this. |
I encountered a similar problem where I first thought Bubblezone was causing the problem (lrstanley/bubblezone#17). After further investigation it seems Bubbleteas mouse handling with If Reproducible example: lrstanley/bubblezone#17 (comment) @knz I tried to use your PR with the help of a replace in the
but even with your EDIT: #594 seems to fix the problem 👀 |
Since #570 gets merged, I think this issue is resolved now. |
Discussed in #664
Originally posted by mschneider82 December 5, 2022
i am using the mouse input and always getting a program exit after a while because of "could not decode rune"
I would expect it continues instead of failing on a invalid utf 8 rune.
The text was updated successfully, but these errors were encountered: