From fdd1007b275fec4423333a9aeb90b0d750a7a1a0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 22 Aug 2020 12:32:12 +0200 Subject: [PATCH] Fix fullscreen example --- examples/fullscreen/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/fullscreen/main.go b/examples/fullscreen/main.go index 2186d3d..e6d73b4 100644 --- a/examples/fullscreen/main.go +++ b/examples/fullscreen/main.go @@ -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) }