Fix fullscreen example

This commit is contained in:
Christian Muehlhaeuser 2020-08-22 12:32:12 +02:00
parent ed03a59e66
commit fdd1007b27
No known key found for this signature in database
GPG Key ID: 3CF9FA45CA1EBB7E
1 changed files with 6 additions and 3 deletions

View File

@ -15,9 +15,12 @@ type model int
type tickMsg time.Time
func main() {
tea.AltScreen()
defer tea.ExitAltScreen()
err := tea.NewProgram(initialize, update, view).Start()
p := tea.NewProgram(initialize, update, view)
p.EnterAltScreen()
err := p.Start()
p.ExitAltScreen()
if err != nil {
log.Fatal(err)
}