This is in my top 10 list of tiny annoying things in Linux. I love colored output in terminals: it's nice to see and useful when reading.
The first thing I do on a new system is to set aliases for both ls
and grep
to show colored output, and the second is to install vim
and htop
.
I use both Gentoo and Ubuntu, and I see that emerge
, the package manager of Gentoo, has a higher readability than apt-get/aptitude
just because it uses way much more color output than the latter.
So, whenever I have to pipe an emerge
command with more
, all the color is lost and I have to focus my attention on every line to avoid missing anything important.
I can understand that a basic command such as more
shouldn't depend on ncurses
(someone could argue that we also have less
, so one of the two could be even color-friendly), but why there isn't a famous alternative to more
that supports colors, as there is for vi/vim
, top/htop
etc.?
Thanks for any hint.
By default, on most Linux distributions these days has ls colors enabled. If your Linux distribution is an exception to this default setting, then you may run ls with –color option to enable colored output.
To set the default Command Prompt window color, select the upper-left corner of the Command Prompt window, select Defaults, select the Colors tab, and then select the colors that you want to use for the Screen Text and Screen Background.
The -F option controls the frequency of the rainbow effect. The -t option enables 24-bit color, while -f forces color output (the options are case-sensitive, like in many other Linux commands). The -i option will invert the foreground and background colors, giving a rainbow background to your terminal text.
Most commands that can output color have an option to choose between:
Many commands work automatically in color AUTO mode. That is the case for emerge
. And that is why you do not have color when you pipe the output: the pioe is not a terminal.
The solution is to tell emerge
to output the colors unconditionally. And tell less
not to filter them, of course.
Try:
emerge --color y | less -R
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With