Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-10-18 22:00:25 +0300
committerSimon Tatham <anakin@pobox.com>2021-10-18 22:15:35 +0300
commit22911ccdcc37c7955bfc1c45a88d3762d1206da7 (patch)
tree0338d603802d802a35ee61330ce2235a2243a442 /config.c
parentc35d8b832801d926a16ad29c416b969654051ef0 (diff)
New config option for shifted arrow key handling.
This commit introduces a new config option for how to handle shifted arrow keys. In the default mode (SHARROW_APPLICATION), we do what we've always done: Ctrl flips the arrow keys between sending their most usual escape sequences (ESC [ A ... ESC [ D) and sending the 'application cursor keys' sequences (ESC O A ... ESC O D). Whichever of those modes is currently configured, Ctrl+arrow sends the other one. In the new mode (SHARROW_BITMAP), application cursor key mode is unaffected by any shift keys, but the default sequences acquire two numeric arguments. The first argument is 1 (reflecting the fact that a shifted arrow key still notionally moves just 1 character cell); the second is the bitmap (1 for Shift) + (2 for Alt) + (4 for Ctrl), offset by 1. (Except that if _none_ of those modifiers is pressed, both numeric arguments are simply omitted.) The new bitmap mode is what current xterm generates, and also what Windows ConPTY seems to expect. If you start an ordinary Command Prompt and launch into WSL, those are the sequences it will generate for shifted arrow keys; conversely, if you run a Command Prompt within a ConPTY, then these sequences for Ctrl+arrow will have the effect you expect in cmd.exe command-line editing (going backward or forward a word). For that reason, I enable this mode unconditionally when launching Windows pterm.
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.c b/config.c
index 4c5da469..dd39862d 100644
--- a/config.c
+++ b/config.c
@@ -2016,6 +2016,12 @@ void setup_config_box(struct controlbox *b, bool midsession,
I(CONF_funky_type),
"ESC[n~", I(0), "Linux", I(1), "Xterm R6", I(2),
"VT400", I(3), "VT100+", I(4), "SCO", I(5), NULL);
+ ctrl_radiobuttons(s, "Shift/Ctrl/Alt with the arrow keys", 'w', 2,
+ HELPCTX(keyboard_sharrow),
+ conf_radiobutton_handler,
+ I(CONF_sharrow_type),
+ "Ctrl toggles app mode", I(SHARROW_APPLICATION),
+ "xterm-style bitmap", I(SHARROW_BITMAP), NULL);
s = ctrl_getset(b, "Terminal/Keyboard", "appkeypad",
"Application keypad settings:");