News for hackers. Stuff that matters.
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/)
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.
Re:Command Line Interface Guidelines by samstave on Wednesday February 07, 2024 @08:08AM (#39288083)
Thats fn cool
Re:Command Line Interface Guidelines by saghm on Friday February 09, 2024 @08:21PM (#39322540)
Huh, not sure how I've never found that option before. Thanks for the lesson, I'll need to rtfm a bit more closely!