7

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).

4 Answers 4

8

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.

3
  • Nice it worked :). Has to see if something else breaks but hopefully not.
    – Buzzzz
    May 29, 2009 at 10:17
  • Hm buy doing so the arrow keys stopped working in midknight commander and centerim..
    – Buzzzz
    May 29, 2009 at 10:47
  • Fixed it for me too, no issues in any apps so far.
    – red
    Dec 27, 2012 at 12:47
4

You can check the configuration, go to

Terminal

--> Keyboard

     --> Function keys and keypad

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

2
  • Well it works fine if I don't use screen. Looks like screen rebinds those keys for some reason.
    – Buzzzz
    May 29, 2009 at 8:06
  • same here @Buzzzz, but it does fix it for me. vim without screen, F1-12 keys work fine. under screen, i get: ^[[14something. Now, if i set my putty setting to "vt100+" (the linux setting did nothing) then i get F1-12 keys working on vim under screen.
    – gcb
    Nov 10, 2014 at 18:18
2

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

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .