unix less - problem with Enter key on numeric keypad

5

2

When I use the unix command 'less' I am constantly frustrated that using the Enter key on the numeric keypad doesn't work but instead types 'ESCOM'.

Is there a way to fix that?

Winter

Posted 2010-05-18T13:39:18.197

Reputation: 253

Answers

6

This is because the number pad's Enter key sends a different command then the keyboard Enter key. You could globally re-map the key to send the normal Return/Enter command, but understand that it will effect how the key works in all the other programs too.

Here are some tips on how to remap the key in X-Windows using xmodmap, or in the console/terminal using loadkeys. You probably want to map keycode 104 ("KP_Enter") to the "Return" command.

ewall

Posted 2010-05-18T13:39:18.197

Reputation: 317

1The articles contain too much unrelated information. A simple excerpt would be great! – donquixote – 2016-08-09T19:57:07.973

1

Use lesskey.

~ $ vi .lesskey
#command
\OM        forw-line
~ $ lesskey

If this character doesn't match the one in your keyboard try using the escaped octal value.
You can also use another action like invalid (beeps) or noaction.

1.61803

Posted 2010-05-18T13:39:18.197

Reputation: 293

I am still lost. How do I find out the octal value? How can I make this change permanent? What does \OM mean? What does forw-line mean? Why the comment at the top, has it any relevance? – donquixote – 2016-08-09T20:03:21.733

The commands above should be enough, provided you know lesskey or read the linked man page. – 1.61803 – 2016-08-10T20:52:54.507