mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Fixed bad loop for checking terminal size
This commit is contained in:
parent
767488a5e7
commit
d404716d0a
1 changed files with 6 additions and 7 deletions
|
|
@ -56,17 +56,16 @@ func NewApp(config *config.AppConfig) (*App, error) {
|
||||||
|
|
||||||
func (app *App) Run() error {
|
func (app *App) Run() error {
|
||||||
// before we do anything, we need to check that we have some window space available
|
// before we do anything, we need to check that we have some window space available
|
||||||
for {
|
var err error
|
||||||
width, _, err := terminal.GetSize(int(os.Stdin.Fd()))
|
width := 0
|
||||||
|
for width == 0 {
|
||||||
|
width, _, err = terminal.GetSize(int(os.Stdin.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if width == 0 {
|
time.Sleep(time.Millisecond * 50)
|
||||||
time.Sleep(time.Millisecond * 50)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
err := app.Gui.RunWithSubprocesses()
|
err = app.Gui.RunWithSubprocesses()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue