From b62910e8cfd2aea6f7c2cf589335c22fcd68873b Mon Sep 17 00:00:00 2001 From: Liam Galvin Date: Mon, 3 Dec 2018 13:00:33 +0000 Subject: [PATCH] add alt backspace --- gui/input.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/input.go b/gui/input.go index 33673bf..d249fcf 100644 --- a/gui/input.go +++ b/gui/input.go @@ -227,7 +227,11 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti }) } case glfw.KeyBackspace: - gui.terminal.Write([]byte{0x08}) + if modsPressed(mods, glfw.ModAlt) { + gui.terminal.Write([]byte{0x17}) // ctrl-w/delete word + } else { + gui.terminal.Write([]byte{0x8}) + } case glfw.KeyUp: if modStr != "" { gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%sA", modStr)))