From d404716d0a3482525b8186785a9699249deccad8 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Tue, 2 Jul 2019 20:14:34 +0200 Subject: [PATCH] Fixed bad loop for checking terminal size --- pkg/app/app.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index dc07d70a..84034da7 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -56,17 +56,16 @@ func NewApp(config *config.AppConfig) (*App, error) { func (app *App) Run() error { // before we do anything, we need to check that we have some window space available - for { - width, _, err := terminal.GetSize(int(os.Stdin.Fd())) + var err error + width := 0 + for width == 0 { + width, _, err = terminal.GetSize(int(os.Stdin.Fd())) if err != nil { return err } - if width == 0 { - time.Sleep(time.Millisecond * 50) - } - break + time.Sleep(time.Millisecond * 50) } - err := app.Gui.RunWithSubprocesses() + err = app.Gui.RunWithSubprocesses() return err }