fix(launcher): use alt screen

This commit is contained in:
bunny winter 2025-02-11 21:58:52 -06:00
parent 3c56e83ac8
commit 4d8f25e42b
Signed by: nya
SSH key fingerprint: SHA256:aFOeJZAb3Y7XJxd+BReehNPp/dmurGW9M13mIayeOm0

View file

@ -97,7 +97,7 @@ func newProgramsKeyMap() *programsKeyMap {
// =======================
// bubbletea model methods
func (m model) Init() tea.Cmd {
return nil
return tea.EnterAltScreen
}
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
@ -314,14 +314,6 @@ func Run(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
// ============
// clear screen
// TODO this feels hacky and should probably be replaced
execCmd := exec.Command("clear")
execCmd.Stdout = os.Stdout
execCmd.Run()
// ====================================
// execute chosen command if one is set
if finalModel, ok := finalModel.(model); ok && finalModel.shouldExec != "" {