Skip to content
Myr

chore: start program with alt screen instead of init

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

As described by the `tea.EnterAltScreen` godocs, the correct way is to initialize the program with the `tea.WithAltScreen`

authored by Jay Morelli · committed by Christian Rocha · parent 6b98c9c · Browse files · 1 file+2 added−2 removed
This commit

State

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

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:examples/list-fancy/main.go+2 added-2 removed
116 unmodified lines
117 }118}119120func (m model) Init() tea.Cmd {121 return tea.EnterAltScreen121 return nil122}123124func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {125 var cmds []tea.Cmd
56 unmodified lines
182183func main() {184 rand.Seed(time.Now().UTC().UnixNano())185186 if _, err := tea.NewProgram(newModel()).Run(); err != nil {186 if _, err := tea.NewProgram(newModel(), tea.WithAltScreen()).Run(); err != nil {187 fmt.Println("Error running program:", err)188 os.Exit(1)189 }190}