diff --git a/src/terminal.go b/src/terminal.go index 5d4eef8..315d9f1 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -190,6 +190,7 @@ const ( func defaultKeymap() map[int]actionType { keymap := make(map[int]actionType) keymap[tui.Invalid] = actInvalid + keymap[tui.Resize] = actClearScreen keymap[tui.CtrlA] = actBeginningOfLine keymap[tui.CtrlB] = actBackwardChar keymap[tui.CtrlC] = actAbort diff --git a/src/tui/ncurses.go b/src/tui/ncurses.go index 5c192e6..5a4d538 100644 --- a/src/tui/ncurses.go +++ b/src/tui/ncurses.go @@ -416,7 +416,7 @@ func GetChar() Event { } return Event{Invalid, 0, nil} case C.KEY_RESIZE: - return Event{Invalid, 0, nil} + return Event{Resize, 0, nil} case ESC: return escSequence() case 127: diff --git a/src/tui/tcell.go b/src/tui/tcell.go index 3ea0412..efa112a 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -183,7 +183,7 @@ func GetChar() Event { ev := _screen.PollEvent() switch ev := ev.(type) { case *tcell.EventResize: - return Event{Invalid, 0, nil} + return Event{Resize, 0, nil} // process mouse events: case *tcell.EventMouse: diff --git a/src/tui/tui.go b/src/tui/tui.go index 7513b6f..6fcaaa4 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -37,6 +37,7 @@ const ( ESC Invalid + Resize Mouse DoubleClick