Why does `less` not recognize the mouse wheel when stdin is a pipe?

0

I was wondering why my less sometimes does not recognize the mouse wheel (my terminal is Konsole). Now I've found a pattern: It seems to work whenever less's STDIN comes directly from the shell (zsh here), e.g.

$ less somefile.txt

But it does not work when STDIN is a pipe from another program, e.g.

$ perl report.pl | less
$ git diff # which implicitly invokes `less`

Any idea what I can do about that?

P.S. Whenever anyone of you writes a program, please make sure to give it a Google-able name. Search results for less mouse wheel or similar are not helpful.

Stefan Majewsky

Posted 2013-04-22T11:30:09.807

Reputation: 61

googling "less mouse-wheel" on the other hand, does produce some apparently useful (or, at least, on-topic) results. – SuperMagic – 2013-04-22T12:17:51.733

more/less predates google by about 20 years. It predates the Internet. People solved problems before Google. – SpliFF – 2013-04-22T12:19:29.303

SuperMagic: Not quite. There are numerous users reporting "mouse wheel does not work at all", but no one with this particular pattern. – Stefan Majewsky – 2013-04-22T13:14:30.253

No answers