@@ -5,6 +5,7 @@ import (
"github.com/charmbracelet/soft-serve/ui/styles"
)
+// Common is a struct all components should embed.
type Common struct {
Styles *styles.Styles
Keymap *keymap.KeyMap
@@ -12,6 +13,7 @@ type Common struct {
Height int
}
+// SetSize sets the width and height of the common struct.
func (c *Common) SetSize(width, height int) {
c.Width = width
c.Height = height
@@ -114,6 +114,7 @@ func (s *Selection) Init() tea.Cmd {
session := s.s.Session()
environ := session.Environ()
termExists := false
+ // Add TERM using pty.Term if it's not already set.
for _, env := range environ {
if strings.HasPrefix(env, "TERM=") {
termExists = true
@@ -188,7 +189,7 @@ func (s *Selection) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case selector.ActiveMsg:
cmds = append(cmds, s.changeActive(msg))
- // reset readme position
+ // reset readme position when active item change
s.readme.GotoTop()
case tea.KeyMsg:
switch {