I'm not very well-versed in the terminology of terminals, but I think there is a bug caused by not calling g.flush() at the beginning of MainLoop(). In my application I switch to a third party process, closing the gui beforehand, then I reinitialize the gui, however I can sneak in keypresses as processes switch, meaning when the mainloop begins again, I get a slice out of bounds error from termbox's PollEvent() where it does this:
Producing repro steps is tricky, but I'm wondering if I'm right in assuming the solution is to chuck a g.flush() as the first line in g.MainLoop()? Testing this locally on my gocui fork works for me
Hey, thanks for making this awesome library!
I'm not very well-versed in the terminology of terminals, but I think there is a bug caused by not calling
g.flush()
at the beginning of MainLoop(). In my application I switch to a third party process, closing the gui beforehand, then I reinitialize the gui, however I can sneak in keypresses as processes switch, meaning when the mainloop begins again, I get a slice out of bounds error from termbox's PollEvent() where it does this:Producing repro steps is tricky, but I'm wondering if I'm right in assuming the solution is to chuck a
g.flush()
as the first line in g.MainLoop()? Testing this locally on my gocui fork works for me