For IntelliJ/JediTerm, allow kBareMod input escapes for navigation keys

Fixes https://github.com/rprichard/winpty/issues/118
This commit is contained in:
Ryan Prichard 2017-05-25 19:41:23 -05:00
parent 4978cf94b6
commit 7d16530ea7

View File

@ -65,10 +65,11 @@ const int kSuffixBoth = kSuffixCtrl | kSuffixShift;
static const EscapeEncoding escapeLetterEncodings[] = {
// Conventional arrow keys
{ true, '[', 'A', kBare | kSemiMod, { VK_UP, '\0', 0 } },
{ true, '[', 'B', kBare | kSemiMod, { VK_DOWN, '\0', 0 } },
{ true, '[', 'C', kBare | kSemiMod, { VK_RIGHT, '\0', 0 } },
{ true, '[', 'D', kBare | kSemiMod, { VK_LEFT, '\0', 0 } },
// kBareMod: Ubuntu /etc/inputrc and IntelliJ/JediTerm use escapes like: ESC [ n ABCD
{ true, '[', 'A', kBare | kBareMod | kSemiMod, { VK_UP, '\0', 0 } },
{ true, '[', 'B', kBare | kBareMod | kSemiMod, { VK_DOWN, '\0', 0 } },
{ true, '[', 'C', kBare | kBareMod | kSemiMod, { VK_RIGHT, '\0', 0 } },
{ true, '[', 'D', kBare | kBareMod | kSemiMod, { VK_LEFT, '\0', 0 } },
// putty. putty uses this sequence for Ctrl-Arrow, Shift-Arrow, and
// Ctrl-Shift-Arrow, but I can only decode to one choice, so I'm just
@ -102,8 +103,9 @@ static const EscapeEncoding escapeLetterEncodings[] = {
// Home/End, letter version
// * gnome-terminal uses `ESC O [HF]`. I never saw it modified.
{ true, '[', 'H', kBare | kSemiMod, { VK_HOME, '\0', 0 } },
{ true, '[', 'F', kBare | kSemiMod, { VK_END, '\0', 0 } },
// kBareMod: IntelliJ/JediTerm uses escapes like: ESC [ n HF
{ true, '[', 'H', kBare | kBareMod | kSemiMod, { VK_HOME, '\0', 0 } },
{ true, '[', 'F', kBare | kBareMod | kSemiMod, { VK_END, '\0', 0 } },
{ true, 'O', 'H', kBare, { VK_HOME, '\0', 0 } },
{ true, 'O', 'F', kBare, { VK_END, '\0', 0 } },