GNU screen display + from putty

Does anyone here know how to get the +-*/ on the numerical keypad to work in GNU screen from putty?

Numbers work fine but not the operators. The / seems to be bind to rename the current shell or maybe start a new shell. My host OS is ubuntu 9.04 (the OS I run the screen on).


Solution 1:

If you set the following in your .screenrc the numpad keys will work

termcapinfo xterm ks@:ke@

I don't know if this will change any other important settings you might be using, however, so it would be worth giving things a test.

It might be that there is a better setting string, but so far I haven't been able to find one.

Update:
I've been searching around looking through termcap, terminfo, terminfo/termcap and screen manuals, but it looks like no-one is having much luck with getting both the number pad and the arrow keys in ncurses apps to work at the same time (they still seem to work in non-ncurses apps).

The closest I've seen is from these threads. Someone spoke to one of the program maintainers regarding an almost identical problem, however as of the 10th of March the problem wasn't resolved.

Solution 2:

You can check the configuration, go to

Terminal

--> Keyboard

     --> Function keys and keypad

Choose whichever works for you. Usually, Linux / Xterm R6

Solution 3:

Another configuration that worked for me:

Go to: Putty configuration->Terminal->Features

Check the Disable application keypad mode check box.

http://vim.wikia.com/wiki/PuTTY_numeric_keypad_mappings

Solution 4:

As per Andy's response adding termcapinfo xterm ks@:ke@ to ~/.screenrc fixed the problem in the shell and the arrow keys do work.

However the arrow keys stopped working in VIM which for me replaced a problem with an even worse problem.

So I added instead to the ~/.screenrc

termcapinfo xterm* ks@:ke@:kl=\E[D:kd=\E[B:kr=\E[C:ku=\E[A

So far so good.