diff --git a/ui.go b/ui.go index 451a4fd..de19fe4 100644 --- a/ui.go +++ b/ui.go @@ -520,17 +520,22 @@ func newUI(screen tcell.Screen) *ui { icons: parseIcons(), } - go func() { - var ev tcell.Event - for { - ev = ui.screen.PollEvent() - ui.evChan <- ev - } - }() + go ui.pollEvents() return ui } +func (ui *ui) pollEvents() { + var ev tcell.Event + for { + ev = ui.screen.PollEvent() + if ev == nil { + return + } + ui.evChan <- ev + } +} + func (ui *ui) renew() { wtot, htot := ui.screen.Size() @@ -1058,6 +1063,8 @@ func (ui *ui) resume() { ui.screen = screen + go ui.pollEvents() + ui.renew() }