jeudi 12 mars 2015

Preventing less from quitting when I scroll down


I don’t know if it was a change to less itself or to the Terminal app, but when I upgraded to Yosemite I noticed that I could use the mouse scroll wheel to move around in less. Whenever I use this feature, though, I end up scrolling down too far and exiting less by accident. (I have the -e option in my $LESS environment variable, so less will quit the second time I reach the bottom of the document.)


Is there any way to preserve the -e behavior while scrolling with the keyboard (e.g. by pressing Space, j, or Control-F) but disable it for the mouse wheel and the trackpad? In other words, if I’m at the bottom of the file then pressing Space should quit less, but no amount of scrolling down will quit less.





Aucun commentaire:

Enregistrer un commentaire