From 7d16530ea73dca4cbc514ad3e725aca03cffd6f4 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Thu, 25 May 2017 19:41:23 -0500 Subject: [PATCH] For IntelliJ/JediTerm, allow kBareMod input escapes for navigation keys Fixes https://github.com/rprichard/winpty/issues/118 --- src/agent/DefaultInputMap.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/agent/DefaultInputMap.cc b/src/agent/DefaultInputMap.cc index e3a4dba..5e29d98 100644 --- a/src/agent/DefaultInputMap.cc +++ b/src/agent/DefaultInputMap.cc @@ -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 } },