I connect to SunOS 5.11 11.3 machine via ssh using putty.
In terminal ctrl + arrow keys are not moving cursor to the previous/next words.
There is simple bash terminal on the Solaris machine.
Do you know how to fix this issue?
In the past I had this issue and already applied the solution (set terminal type string in putty to "linux"), but now I also want arrow keys working.
Best Answer
PuTTY doesn't do that. It's a feature of xterm, and is one of many features of xterm not provided by PuTTY: sending different escape sequences depending on whether the Control and/or Shift key is pressed at the same time.
xterm-style modifiers for cursor keys are supported in ncurses by a extended terminal description (not part of conventional X/Open or SVr4 terminfo). However, PuTTY does not implement xterm-style modifiers in this case. For a long time, it used the Shift key to switch between normal and application modes for the cursor keys, and recently changed the modifier to the Control key:
but that did not change the escape sequence used. In the change comment,
ESC [ A
refers to the normal-mode up-arrow, andESC O A
to the application-mode up-arrow.ncurses provides an accurate terminal description for PuTTY, but in this case the terminal description is irrelevant because bash uses hard-coded escapes in
.inputrc
(zsh does a little better, but also is lacking in this area--see the xterm manual). Even supposing that bash used the terminal description, the information is not available to bash because the terminal description's names cannot be read using a termcap application (such as bash). As mentioned, zsh is a little better, but it does not read extensions.Using
you might notice
kLFT5
,kRIT5
,kUP5
,kDN5
(which are the names given to the control-modified cursor keys--all extensions), but you will not find those in theputty
terminal description because PuTTY doesn't do that.