In the manpage of less
the up- and down-arrow keys aren't mentioned in the context of normal navigation, yet on Debian Linux (8.2) they obviously work to scroll up and down. Why is this? A lesskey file is mentioned in the manpage, maybe it is defined there?
I can't find this file anywhere, does it exist in the standard installation of Debian?
Debian – Arrow keys in `less`
debianlesslinux
Best Answer
The manual page, e.g, as you might find on OSX or Unix commands is incomplete:
less
initializes itself using the termcap strings for the cursor keys, home/page keys, pageup/pagedown keys.LESS_TERMCAP_
, e.g.,LESS_TERMCAP_ku
to override theku
(cursor-up) string.Looking at the source code, there's a table
cmdtbl
indecode.c
which gives initial key-bindings, e.g.,You may be able to see the pattern here: they all go back one line. But I do not see any of that in the manual page.
Further reading: