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?


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.

  • 1
    The articles contain too much unrelated information. A simple excerpt would be great! – donquixote Aug 9 '16 at 19:57

Use lesskey.

~ $ vi .lesskey
\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.

  • 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 Aug 9 '16 at 20:03
  • The commands above should be enough, provided you know lesskey or read the linked man page. – 1.61803 Aug 10 '16 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.