From 5df038d223b96cf140e97a37916319b151a69f3c Mon Sep 17 00:00:00 2001 From: Liam Galvin Date: Mon, 3 Dec 2018 12:14:03 +0000 Subject: [PATCH] fix home button --- gui/input.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/input.go b/gui/input.go index ad82c6d..33673bf 100644 --- a/gui/input.go +++ b/gui/input.go @@ -167,10 +167,14 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti '3', '~', }) case glfw.KeyHome: - if modStr == "" { - gui.terminal.Write([]byte("\x1b[1~")) + if gui.terminal.IsApplicationCursorKeysModeEnabled() { + if modStr == "" { + gui.terminal.Write([]byte("\x1b[1~")) + } else { + gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%s~", modStr))) + } } else { - gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%s~", modStr))) + gui.terminal.Write([]byte("\x1b[H")) } case glfw.KeyEnd: if modStr == "" {