summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-05-02 19:14:02 +0200
committerewy <ewy0@protonmail.com>2026-05-02 19:14:02 +0200
commit45847dc53ec51c090175d8621711250b60b28263 (patch)
tree167f836037a75f441a1f2bdc53dbab096cd2806a
parentd1633e905a1487e8845088c03db8faf53d587e46 (diff)
initialize altscreen properly
-rw-r--r--menu/menu.go3
-rw-r--r--menu/model.go2
2 files changed, 3 insertions, 2 deletions
diff --git a/menu/menu.go b/menu/menu.go
index b524d95..2593d15 100644
--- a/menu/menu.go
+++ b/menu/menu.go
@@ -15,8 +15,7 @@ func Show(st *model.State, hydrators []model.Modder) (*Model, error) {
return nil, NoSourcesIndexedError
}
md := NewModel(st, hydrators)
- var opts []tea.ProgramOption
- program := tea.NewProgram(md, opts...)
+ program := tea.NewProgram(md)
resultModel, err := program.Run()
if err != nil {
return nil, err
diff --git a/menu/model.go b/menu/model.go
index 4480c96..302315a 100644
--- a/menu/model.go
+++ b/menu/model.go
@@ -4,6 +4,7 @@ import (
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/x/term"
+ "github.com/ewy1/pik/flags"
"github.com/ewy1/pik/model"
"github.com/ewy1/pik/motd"
"github.com/ewy1/pik/spool"
@@ -145,6 +146,7 @@ func NewModel(st *model.State, hydrators []model.Modder) *Model {
Index: 0,
Indices: make(map[int]model.HydratedTarget),
SourceIndices: make(map[int]*model.HydratedSource),
+ Alt: !*flags.Inline,
AutoAlt: !pflag.Lookup("inline").Changed && !isBanned,
Motd: motd.One(),
Search: textinput.New(),