From 35e044d140b8b88efc56fb104dcf70f7f8e1d871 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Thu, 4 Aug 2022 11:21:51 -0400 Subject: [PATCH] fix: use WithAltScreen instead of deprecated EnterAltScreen --- filter/command.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/filter/command.go b/filter/command.go index d9a16e6..239b839 100644 --- a/filter/command.go +++ b/filter/command.go @@ -35,6 +35,11 @@ func (o Options) Run() error { choices = files.List() } + options := []tea.ProgramOption{tea.WithOutput(os.Stderr)} + if o.Height == 0 { + options = append(options, tea.WithAltScreen()) + } + p := tea.NewProgram(model{ choices: choices, indicator: o.Indicator, @@ -45,11 +50,7 @@ func (o Options) Run() error { matchStyle: o.MatchStyle.ToLipgloss(), textStyle: o.TextStyle.ToLipgloss(), height: o.Height, - }, tea.WithOutput(os.Stderr)) - - if o.Height == 0 { - p.EnterAltScreen() - } + }, options...) tm, err := p.StartReturningModel() m := tm.(model)