Number pad issues when using a remote 'nano' instance in PuTTY

5.1k views Asked by At

I'm using PuTTY on an old Windows laptop to communicate with Ubuntu.

When using the terminal, everything is fine and I can use the numpad normally. However, when I open anything in nano, all these keys have functions instead of numbers.

I did a search about this and found a few solutions to change PuTTY settings, but they didn’t have any effect. Is this an issue with PuTTY or with nano?

2

There are 2 answers

0
Thomas Dickey On

nano uses the curses keypad function, turning it on (so that curses handles cursor-keys). The terminal description turns on application mode for both the cursor-keys and the numeric keypad, which with PuTTY makes it send the non-numeric stuff.

You could modify the terminal description to remove the numeric-keypad part of the smkx capability:

infocmp -1 >foo
vi foo
... look for smkx=\E[?1h\E=,
... change that to smkx=\E[?1h,
tic foo
4
zrobotics On

For anyone else with this problem—this is PuTTY specific and is caused by the application keypad mode sending escape sequences to nano.

To solve it:

From an open PuTTY terminal:

  • Ctrl + right-click to bring up the context menu
  • Select "Change Settings..."
  • Select TerminalFeatures in the left-hand navigation tree
  • Check "Disable application keypad mode"

Reference: Description of bug on the Vim (FANDOM.com??) wiki