add alt backspace

This commit is contained in:
Liam Galvin 2018-12-03 13:00:33 +00:00
parent 0ab63e3946
commit b62910e8cf
1 changed files with 5 additions and 1 deletions

View File

@ -227,7 +227,11 @@ func (gui *GUI) key(w *glfw.Window, key glfw.Key, scancode int, action glfw.Acti
}) })
} }
case glfw.KeyBackspace: 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: case glfw.KeyUp:
if modStr != "" { if modStr != "" {
gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%sA", modStr))) gui.terminal.Write([]byte(fmt.Sprintf("\x1b[1;%sA", modStr)))