Don't query for terminal dimensions when starting up

This commit is contained in:
Christian Rocha 2020-05-18 15:00:44 -04:00 committed by Christian Muehlhaeuser
parent 131685b5f2
commit e685dea17a

View file

@ -15,7 +15,6 @@ import (
"github.com/charmbracelet/glamour"
"github.com/muesli/reflow/indent"
te "github.com/muesli/termenv"
"golang.org/x/crypto/ssh/terminal"
)
const (
@ -91,8 +90,6 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
s.Type = spinner.Dot
s.ForegroundColor = common.SpinnerColor
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
if style == "auto" {
dbg := te.HasDarkBackground()
if dbg == true {
@ -103,12 +100,9 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
}
return model{
style: style,
spinner: s,
state: stateInitCharmClient,
err: err,
terminalWidth: w,
terminalHeight: h,
style: style,
spinner: s,
state: stateInitCharmClient,
}, boba.Batch(
newCharmClient,
spinner.Tick(s),