Configure keyboard codes on the client-side to move PuTTY cursor between words

1

Related to StackOverflow Bash CTRL to move cursor between words/strings. While that thread provided good answers on the server-side, I'm looking for ways to control this on the client-side.

I have two Windows 10 PCs from different manufacturers that send different escape codes for CTRL-<ARROW>. They are running the same PuTTY version and configuration. Both Windows are configured with the same keyboard language.

One sends codes that moves the cursor between words, the other does not. I understand I can configure the server-side to map the non-conforming codes to move between words. However, there are just too many servers to make this practical and some are embedded systems that make this impossible. Instead, I'm looking for a way to tell the client to use the desired key codes.

The keyboard that works on all servers sends:

^[[1;5D = ctrl-left
^[[1;5C = ctrl-right

The other keyboard sends:

^[OD = ctrl-left
^[OC = ctrl-right

None of the servers map ^[OD nor ^[OC in their /etc/inputrc file (e.g. bind -p | grep forward-word)

How do I control the keyboard codes on the client-side?

Matt Muggeridge

Posted 2017-09-19T20:24:37.213

Reputation: 63

No answers