3 ms·
> 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 do
by faho 4y ago
> 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.
- efreak 4y agoMore 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. ```