release notes
release notes
Published 6/2/2021
MinorContains breaking changesThis release introduces three new ProgramOptions for starting programs with the altscreen and mouse enabled. This was implemented to solve both race conditions when initializing programs as well as correctness with regard to custom inputs.
// New! This is the recommended way to start your program with the mouse and altscreen active.
p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithMouseAllMotion())
// Deprecated as this will only operate on stdout, as opposed to a custom output you may have set.
p := tea.NewProgram(model)
p.EnableAltScreen()
p.EnableMouseAllMotion()
// Strongly discouraged as these commands could be sent before starting the renderer, resulting
// in rendering artifacts. This is due to the fact that commands run asynchronously in a goroutine.
func (m model) Init() tea.Cmd {
return tea.Batch(tea.EnterAltScreen, tea.EnableMouseAllMotion)
}
Also included are two subtle—yet important—rendering improvements.
ProgramOption WithAltScreen for starting programs in the alternate screen buffer.ProgramOptions WithMouseCellMotion and WithMouseAllMotion for starting programs with the mouse enabled.Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or right here in GitHub Discussions.
release notes
Published 6/2/2021
MinorContains breaking changesThis release introduces three new ProgramOptions for starting programs with the altscreen and mouse enabled. This was implemented to solve both race conditions when initializing programs as well as correctness with regard to custom inputs.
// New! This is the recommended way to start your program with the mouse and altscreen active.
p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithMouseAllMotion())
// Deprecated as this will only operate on stdout, as opposed to a custom output you may have set.
p := tea.NewProgram(model)
p.EnableAltScreen()
p.EnableMouseAllMotion()
// Strongly discouraged as these commands could be sent before starting the renderer, resulting
// in rendering artifacts. This is due to the fact that commands run asynchronously in a goroutine.
func (m model) Init() tea.Cmd {
return tea.Batch(tea.EnterAltScreen, tea.EnableMouseAllMotion)
}
Also included are two subtle—yet important—rendering improvements.
ProgramOption WithAltScreen for starting programs in the alternate screen buffer.ProgramOptions WithMouseCellMotion and WithMouseAllMotion for starting programs with the mouse enabled.Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or right here in GitHub Discussions.