On 9/15/26 16:32, Collin Funk wrote:
Because I thought it was useful that way when piping --help to | less -R
(less is generally configured to use -R by default
since it's a lot more useful like that to display colors etc.)
Doing that also maintains the highlighting.

All true, but it's counterintuitive that "realpath --help | grep foo" behaves differently from "ls | grep foo". ls disables all the colors and linking, realpath doesn't.

I suspect this is a case where the benefits of the link are less than the ability to process the output as text.

One possible way out is for invocations like 'realpath --help' to automatically pipe their output into 'less' if stdout is a tty. That would be more convenient than 'realpath --help|less' anyway, and would solve the problem in a better way.

It that way out isn't feasible for some reason, it might be better for realpath to do what ls does.



Reply via email to