This is not a bug in gocui. It should be fixed in OSX (making iTerm2/Terminal.app's xterm emulation to send ESC sequences atomically) or in termbox-go (supporting the way used by iTerm2/Terminal.app to report mouse events).
On OSX, when Gui.Mouse is enabled and the focus is in an editable buffer, if the terminal receives mouse events, the event loop receives an EventKey for each byte of the ESC sequence that corresponds to the mouse event. Because it is an editable buffer, these sequences end up being written in the buffer, as can be seen in the following screenshot:
This happens because iTerm2 or Terminal.app do not send the ESC sequence atomically.
This is not a bug in gocui. It should be fixed in OSX (making iTerm2/Terminal.app's xterm emulation to send ESC sequences atomically) or in termbox-go (supporting the way used by iTerm2/Terminal.app to report mouse events).
More information: https://github.com/nsf/termbox-go/issues/120
On OSX, when Gui.Mouse is enabled and the focus is in an editable buffer, if the terminal receives mouse events, the event loop receives an EventKey for each byte of the ESC sequence that corresponds to the mouse event. Because it is an editable buffer, these sequences end up being written in the buffer, as can be seen in the following screenshot:
This happens because iTerm2 or Terminal.app do not send the ESC sequence atomically.