You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application crashes with a runtime error: "invalid memory address or nil pointer dereference" when trying to set the window title using Bubble Tea's SetWindowTitle method.
This behavior occurs on both Windows and Ubuntu
Source Code
funcmain() {
varrootCmd=&cobra.Command{
Use: "game",
Short: "Tic-Tac-Toe game",
Long: "A simple Tic-Tac-Toe game written in Go using the Bubble Tea library and the Lip Gloss library.",
Run: func(cmd*cobra.Command, args []string) {
p:=tea.NewProgram(model{}, tea.WithAltScreen())
p.SetWindowTitle("Welcome to the game")
if_, err:=p.Run(); err!=nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
},
}
iferr:=rootCmd.Execute(); err!=nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}
The text was updated successfully, but these errors were encountered:
Hi @DziedzicGrzegorz, that's a bug indeed! FWIW, using p.SetWindowTitle is deprecated or should be, you should use tea.SetWindowTitle instead in your model Init(). Meanwhile, I will push a fix for this bug momentarily.
Using program commands like p.EnableMouseCellMotion and p.SetWindowTitle
_before_ the program starts can panic the application since `renderer`
hasn't been initialized yet. Use program options to enable and set these
options if `renderer` is not initialized.
Fixes: #1029
Using program commands like p.EnableMouseCellMotion and p.SetWindowTitle
_before_ the program starts can panic the application since `renderer`
hasn't been initialized yet. Use program options to enable and set these
options if `renderer` is not initialized.
Fixes: #1029
Describe the bug
The application crashes with a runtime error: "invalid memory address or nil pointer dereference" when trying to set the window title using Bubble Tea's
SetWindowTitle
method.This behavior occurs on both Windows and Ubuntu
Source Code
The text was updated successfully, but these errors were encountered: