From a85d22cf5418df83d8eafd47de24b0a0437cdfb1 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 13 Oct 2020 14:38:19 -0400 Subject: [PATCH] Handle arrows on Powershell on Unix-like systems --- key.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/key.go b/key.go index 309c4de..4727a0b 100644 --- a/key.go +++ b/key.go @@ -253,7 +253,7 @@ var hexes = map[string]Key{ "1b5b48": {Type: KeyHome}, "1b5b377e": {Type: KeyHome}, // urxvt "1b5b313b3348": {Type: KeyHome, Alt: true}, - "1b1b5b377e": {Type: KeyHome, Alt: true}, // ursvt + "1b1b5b377e": {Type: KeyHome, Alt: true}, // urxvt "1b5b46": {Type: KeyEnd}, "1b5b387e": {Type: KeyEnd}, // urxvt "1b5b313b3346": {Type: KeyEnd, Alt: true}, @@ -268,6 +268,12 @@ var hexes = map[string]Key{ "1b5b313b3342": {Type: KeyDown, Alt: true}, "1b5b313b3343": {Type: KeyRight, Alt: true}, "1b5b313b3344": {Type: KeyLeft, Alt: true}, + + // Powershell + "1b4f41": {Type: KeyUp, Alt: false}, + "1b4f42": {Type: KeyDown, Alt: false}, + "1b4f43": {Type: KeyRight, Alt: false}, + "1b4f44": {Type: KeyLeft, Alt: false}, } // readInput reads keypress and mouse input from a TTY and returns a message