On Tue, 16.07.13 15:06, Chris Adams (linux@cmadams.net) wrote:
Once upon a time, John.Florian@dart.biz John.Florian@dart.biz said:
While I'm no more important than the next guy, I'll defend the auto-pager feature of both git and journalctl. I love it, in fact. I'm no stranger to very long pipelines and sub-shells but I see nothing but benefit in not having to add "| less" routinely to things that are UI in nature.
My primary objection is that I don't like things that have differing behavior between a TTY and a pipe. One problem is if you are writing a script to process output from something, you'll probably run the command in a TTY to check the output, but you'll get different results.
There are not many programs that have such TTY/pipe behavior. The only ones that come to mind are "ps" (where output is truncated at screen width) and "ls" (where "--color=tty" changes between TTY and pipe). The ls behavior makes sense (and doesn't change the information displayed, formatting, etc.); the "ps" behavior is annoying. I guess "man" has similar auto-pager behavior to systemctl/journalctl (although IMHO man is a different type of thing, since it is a documentation reader).
ls, ps, man, git, wget, gcc, grep, pstree, bash, lsblk, lslocks, ...
And this is where I got bored and stopped looking.
We already have pipes, and anyone that knows how to use a Unix shell knows how to use them. IMHO it is extra complication (and code duplication) for programs to change behavior between a TTY and a pipe, unless there are specific things that can't easily be accomplished with a simple pipe (such as "ls --color=tty"). Pagination, truncation, etc. are easy using pipes, and should not be done in regular programs.
But anyway, this subthread is pointless. You won't convince me that auto-paging is awful, you can just drop the thread entirely, it's pointless.
Lennart