Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[patch] portage-utils: Colored output to files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
teika
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2011
Posts: 121
Location: YYYY-MM-DD, period. Have you ever used the Internet?

PostPosted: Tue Oct 27, 2020 12:55 am    Post subject: [patch] portage-utils: Colored output to files Reply with quote

As of app-portage/portage-utils-0.90,
$ q
does print in color, but if you do
$ q > file
it will be colorless. I wrote a quick patch that makes outputs always in color, unless you pass --nocolor.

Get it here. Save it as /etc/portage/patches/app-portage/portage-utils/notty-color.patch, re-emerge, and you're done.

Don't send it to bugzilla and annoy Gentoo developers. Once you enhance it to
--color=always/auto/never
i.e. as "ls (1)" does, I guess it'll be ok.

Regards.
_________________
Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery: topic 865313

Be kind to the disadvantaged. That includes T***p supporters, and those hypocrites that called Trump supporters "deplorable."
Back to top
View user's profile Send private message
Ionen
Veteran
Veteran


Joined: 06 Dec 2018
Posts: 1448

PostPosted: Tue Oct 27, 2020 1:13 am    Post subject: Reply with quote

If want to avoid patches in situations like that, can always force it with the script command (from util-linux), like:
Code:
script -aefq /dev/null -c "quse -Dvp firefox" | grep www-client > stillcolored
Can also replace /dev/null by the actual file and it'll work more like bin/tee. Given it makes the command a bit nasty, makes more sense with an alias/wrapper.

Not that I don't agree portage-utils needs an option to control this rather than be auto-detection-only.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum