burntsushi 3 days ago

> I don't expect the tools to change their output format on me.

You probably do! If you've ever used `ls`, then it does exactly this.

1
sudahtigabulan 3 days ago

If you mean the ANSI color stuff, yes - I do expect these to disappear :)

I meant the "shape" of the output. It just doesn't follow the principle of least surprise.

edit: you probably meant the columns. I forgot about that, I haven't parsed ls(1) output in ages ;)

burntsushi 3 days ago

Yes. The columns. The point is that commands have been changing their output format, not just their colors, based on tty for ages. So the criticism you lodge against ripgrep also applies to some of the most core commands you probably use daily.

I would be quite surprised if you didn't rely on this without even knowing it. Even a simple `ls | wc -l` relies on it.

I say this because it's tiring to see folks lament about this feature in ripgrep as if it's something new that ripgrep does. It's not. It's a well established idiom among Unix command line tools.

volemo 3 days ago

Isn’t “don’t parse ls” like the third commandment of Unix?

burntsushi 2 days ago

You've never done `ls | wc -l`?

BenjiWiebe 2 days ago

I've always assumed that ls doesn't change it's output when piped; I've always done ls -1|wc -l. I guess I can save on a few keystrokes now.