Skip to content
Myr

Wrap termenv altscreen functions to make things simpler for the end user

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent f94701a · Browse files · 2 files+14 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−3 removed

  • other:+14 added−3 removed

2 files+14 added−3 removed

modified:examples/fullscreen/main.go+2 added-3 removed
6 unmodified lines
7 "log"8 "time"910 "github.com/charmbracelet/tea"11 "github.com/muesli/termenv"11)1213type model int1415type tickMsg struct{}1617func main() {19 termenv.AltScreen()20 defer termenv.ExitAltScreen()18 tea.AltScreen()19 defer tea.ExitAltScreen()20 err := tea.NewProgram(initialize, update, view, subscriptions).Start()21 if err != nil {22 log.Fatal(err)23 }
45 unmodified lines
modified:tea.go+12 added
267 unmodified lines
268 }269270 return activeSubs271}272273// AltScreen exits the altscreen. Just is just a wrapper around the termenv274// function275func AltScreen() {276 termenv.AltScreen()277}278279// ExitAltScreen exits the altscreen. Just is just a wrapper around the termenv280// function281func ExitAltScreen() {282 termenv.ExitAltScreen()283}