Re:Command Line Interface Guidelines
by saghm on Tuesday February 06, 2024 @07:43PM
(#39283025)
You can see this pretty easily with `ls` as well by using different options for the color. If you run `ls --color=auto`, you'll get colored output when running directly but black and white output if you pipe to `less`. However, if you pass `--color=always`, you'll get colored output when running directly and a bunch of garbage around some of the entries when piping to `less` because it doesn't interpret ANSI escape codes for color by default (although depending on what the output you're piping into `less` is, there are some workarounds like https://www.gnu.org/software/src-highlite/)
[ Parent
| on HN ]
Re:Command Line Interface Guidelines
by funcDropShadow on Wednesday February 07, 2024 @06:57AM
(#39287459)
You can use ls --color=always | less -R to render the colors in less.