Shift-Space in less

lesspagerterminal

In modern web browsers and other software with text content, Space scrolls down more or less a screenful. ShiftSpace scrolls up in everything but less.

How can one use ShiftSpace to scroll up in less? Or alternatively, is there another pager (POSIX compatibility is my only requirement) that could do the job?

I was told some terminal emulators, and some terminal UI libraries (ncurses?), don't recognize ShiftSpace. Is that a valid issue?

Best Answer

I think you've brought up a culture clash caused by a technical limitation. Since Shift+Space generates the same output as Space, the Unix terminal model treats them identically. To distinguish between the two, you need a programming environment that supports key up / key down events. That is possible in X11 and in terminal emulators that support remapping keys. An example of remapping Shift+Space to PageUp:

# For [u]rxvt, in ~/.Xdefaults:
URxvt.keysym.Shift-space: \033[5~
Related Question