get rid of residual escape codes after skipping shell commands

Some applications (e.g. vim) seem to leave behind escape codes in the
terminal after quitting. For some terminals (including xterm and
gnome-terminal) this is somehow interpreted as key strokes by lf. This
is a temporary fix to get rid of these escape codes by restarting
termbox until we can find a proper way to handle this.
This commit is contained in:
Gokcehan 2016-08-21 14:15:19 +03:00
parent a6d92f4a12
commit 66ce56eb6e

6
ui.go
View File

@ -484,6 +484,12 @@ func (ui *UI) sync() {
}
termbox.SetCursor(0, 0)
termbox.HideCursor()
// TODO: is there an easier way to clear residual escape codes?
termbox.Close()
if err := termbox.Init(); err != nil {
log.Fatalf("initializing termbox: %s", err)
}
}
func (ui *UI) listBinds(binds map[string]Expr) {