4 ms·
Many legacy and contemporary programs change their output behaviour based on if they're outputting to a tty or to a pipe. Off the top of my head, ls (as old as
by Asooka 9y ago
Many legacy and contemporary programs change their output behaviour based on if they're outputting to a tty or to a pipe. Off the top of my head, ls (as old as you can get) and git (new) do not colourise their output by default for pipes, but do colourise for terminals. This is just curl trying to be a good citizen on the terminal, for which there is plenty of precedent.
- ComputerGuru 9y agoNot just colour. The actual formatting and layout of ls output changes, too.
- Dylan16807 9y agoAnd it's sometimes helpful, but sometimes a big pain because you just wanted to pipe it into less.
- lathiat 9y agothis drives me slightly nuts but I get why people do it.. I really wish for some kindof smarter negotiation between pipes. I often end up doing things like: watch --color juju status --color or "ls -c | less -r", etc.