Hacker News new | ask | show | jobs
by ketanmaheshwari 1069 days ago
Slightly related, I recently discovered that `less` can read pdf files out of the box. Seems like it is working on Linux but not on macOS.
2 comments

MacOS comes with an old version of less (581.2) - as Apple fears and avoids GPL v3.

Brew etc holds newer versions - but this particular issue probably has to do with missing lesspipe:

https://github.com/wofr06/lesspipe#42-list-of-preprocessed-f...

This is likely lesspipe.sh used via LESSOPEN. Less itself certainly doesn’t understand PDF, but it allows automatic custom preprocessing of its input, which many Linux distributions have preconfigured as the system default.