From a256e76ff5ff142d747ad833c7aa784113f8558c Mon Sep 17 00:00:00 2001 From: Jay Morelli Date: Tue, 15 Aug 2023 16:21:31 +0100 Subject: [PATCH] chore: start program with alt screen instead of init As described by the `tea.EnterAltScreen` godocs, the correct way is to initialize the program with the `tea.WithAltScreen` --- examples/list-fancy/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/list-fancy/main.go b/examples/list-fancy/main.go index 3646cebe7b..dfa580ae14 100644 --- a/examples/list-fancy/main.go +++ b/examples/list-fancy/main.go @@ -118,7 +118,7 @@ func newModel() model { } func (m model) Init() tea.Cmd { - return tea.EnterAltScreen + return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { @@ -183,7 +183,7 @@ func (m model) View() string { func main() { rand.Seed(time.Now().UTC().UnixNano()) - if _, err := tea.NewProgram(newModel()).Run(); err != nil { + if _, err := tea.NewProgram(newModel(), tea.WithAltScreen()).Run(); err != nil { fmt.Println("Error running program:", err) os.Exit(1) }