mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Add ProgramOptions for entering the altscreen and enabling the mouse
Because they run ansyncronously, the analogous commands, when run in a Model's Init() function, could fire after the renderer has starting writing to output, rendering artifacts to the commandline.
This commit is contained in:
@@ -16,7 +16,8 @@ type model int
|
||||
type tickMsg time.Time
|
||||
|
||||
func main() {
|
||||
if err := tea.NewProgram(model(5)).Start(); err != nil {
|
||||
p := tea.NewProgram(model(5), tea.WithAltScreen())
|
||||
if err := p.Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user