From e685dea17aa3231c0b2cdb373ac78bb94655fbf2 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 18 May 2020 15:00:44 -0400 Subject: [PATCH] Don't query for terminal dimensions when starting up --- ui/ui.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ui/ui.go b/ui/ui.go index 811c12c..0c8b452 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -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),