wofr06 / lesspipe

lesspipe - display more with less
GNU General Public License v2.0
484 stars 51 forks source link

Implement file size limit #127

Closed gdevenyi closed 1 year ago

gdevenyi commented 1 year ago

For raw files which less can already handle, lesspipe's processing can result in great delays.

If I have a 39GB CSV file, lesspipe probably shouldn't try to process it before display.

An environment variable (with a default) to set the maximum size before falling-back to no pipe would be helpful.

wofr06 commented 1 year ago

Some programs insist on seeing the whole file, otherwise they report an error. Therefore a global limit is not practicable. You could always use the behaviour of less in a pipe to switch of processing such as cat file|less. If this is not good enough, as one could be tempted to always type less ... then again a lessfilter (testing on the size and the file ending) would be another solution. I tend not to add such a test in the version that gets distributed, as this seems to be a rather special case.