I am accessing a linux box via ssh
using putty
.
Key combinations work fine when I'm not running screen
.
However, Ctrl key combinations do not work under a screen
session.
In fact, a Ctrl-any key is registered the same as the same key without the Ctrl combination.
I know this by typing Ctrl-V and then a Ctrl-key combination to figure out what characters are sent to my terminal.
For example, Ctrl-◄ (left arrow) gives me ^[[D
on screen
(screen256-color term). ◄ gives me the same result.
Weird thing is that Alt-key combinations work fine.
In particular, I would like to get the 'forward-word' and 'backward-word' key bindings working under screen
.
I have tried modifying .inputrc
to work with various terminals. As such, my .inputrc
looks something like this:
$if term=xterm
'xxx' : forward-word # xxx key gotten from Ctrl-V
'xxx' : backward-word
$endif
$if term=screen-256color
...
...
I have also tried various terminals by setting the TERM
of my bash
profile, setting TERM
on .screenrc
, and setting the Putty
keyboard terminal mappings. The obvious ones, linux
and xterm
, don't work. However, I haven't tried every permutation of settings for obvious reasons.
Additional info:
I stand corrected, arrow key combinations are the only combinations that do not work. The distro is RHEL 6.
.screenrc:
term xterm # tried other terms as well
shell -$SHELL # login shell to reload configs
caption string "%w"
hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %{g}%c %{w}| %{y}%d.%m.%Y %{w}| %{g}%l %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"
vbell off
defscrollback 5000
Putty's default keyboard mode ESC [n~
.
Taken from the putty manual: "In the default mode, labelled ESC [n~, the function keys generate sequences like ESC [11~, ESC [12~ and so on. This matches the general behaviour of Digital's terminals."
Interestingly, what's actually sent by Putty
(by following the first answer on https://superuser.com/questions/342848/cant-get-keyboard-to-work-correctly-in-putty), is
^[0D : left-arrow
^[[D : Ctrl-{left-arrow}
Since the they are different, I guess putty
isn't the issue then?
FWIW, I tried changing the Application Cursor key mode settings on Putty, but to no avail. I also tried using tmux
, only to encounter the same issue.
Ctrl+V
doesn't act likeV
, then evidently some Ctrl+key combinations do work. Which ones don't work? Arrow keys? What distribution is this, what is present in/etc/screenrc
and~/.screenrc
? what key combination does PuTTY send for the Ctrl+key combinations that don't work in screen?