News for hackers. Stuff that matters.
Re:New(ish) command line tools by faho on Wednesday April 13, 2022 @02:09AM (#31011676)
> automatically have this for any command that outputs more than 10 lines?

Probably not. The output of a command typically goes directly to the terminal and does not pass through the shell, so the shell has no idea how many lines there are.

You could write a shell where that's not the case, but that would have issues with interactive things - what happens if you run e.g. vim or htop in that context?

You can pipe to `less -F` (`--quit-if-one-screen`), but note that the version of `less` shipped with macOS has a bug and might just swallow the output instead.

Re:New(ish) command line tools by efreak on Thursday April 14, 2022 @08:35PM (#31035324)
More likely is a feature to skip processing on short outputs, like `less -F`

``` -F ........ --quit-if-one-screen Quit if entire file fits on first screen. ```