Skip to content

Commit a4fd7c4

Browse files
committed
Add aliases for alt-left, alt-right and delete-word
1 parent 03fcf44 commit a4fd7c4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

terminal.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) {
181181
return r, b[l:]
182182
}
183183

184+
if !pasteActive && len(b) >= 2 && b[0] == keyEscape {
185+
switch b[1] {
186+
case 'b':
187+
return keyAltLeft, b[2:]
188+
case 'f':
189+
return keyAltRight, b[2:]
190+
case 127:
191+
return keyDeleteWord, b[2:]
192+
}
193+
}
194+
184195
if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' {
185196
switch b[2] {
186197
case 'A':

0 commit comments

Comments
 (0)