-
Notifications
You must be signed in to change notification settings - Fork 269
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
placeholder view Unicode character encoding error #420
Comments
Oooof. Thanks for the report. I'm able to reproduce this (Wezterm, Linux, en_US.UTF-8). package main
import (
"fmt"
"os"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
)
type model struct {
i textinput.Model
}
func (m model) Init() tea.Cmd {
return m.i.Focus()
}
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
if msg.Type == tea.KeyCtrlC || msg.Type == tea.KeyEsc {
return m, tea.Quit
}
}
var cmd tea.Cmd
m.i, cmd = m.i.Update(msg)
return m, cmd
}
func (m model) View() string {
return m.i.View() + "\n"
}
func main() {
i := textinput.New()
i.Prompt = "> "
i.Placeholder = "馹ABC"
m := model{i: i}
if _, err := tea.NewProgram(m).Run(); err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
}
} |
You're welcome! I'm glad to hear that you were able to reproduce the issue. Whenever you have a moment ,could you kindly review and consider merging my PR ? Thank you for your time. |
Oh brilliant, I totally missed that you have have a patch. Let's get this done! |
Thank you SO much for both flagging and patching this! 🙌 Fixed by #421. |
Describe the bug
Placeholder
View renders got Unicode character encoding errorSetup
use
textinput.Model
set Unicode character is the PlaceholderThe text was updated successfully, but these errors were encountered: