View previous topic :: View next topic |
Author |
Message |
teika Apprentice
Joined: 19 Feb 2011 Posts: 163 Location: YYYY-MM-DD, period. Have you ever used the Internet?
|
Posted: Tue Oct 27, 2020 12:55 am Post subject: [obsolete] portage-utils: Colored output to files |
|
|
[This thread is obsolete; second edit in Apr 2023]
[First edit of Apr 2023]
As of app-portage/portage-utils-0.94.3, (Apr 2023)
$ q
does print in color, but if you do
$ q > file
it will be colorless. For a workaround, see the next message by Ionen.
Don't submit a wish item to bugzilla and annoy Gentoo developers. If you can, please write a patch to accept an option:
--color=always/auto/never
i.e. as "ls (1)" does.
Thanks.
[Original message]
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. _________________ Hack of easy Shift / Ctrl / AltGr etc; save your pinkies, type without drudgery: topic 865313
BTRFS - Biden & TRump, Fools Suck.
Last edited by teika on Sat Apr 15, 2023 12:57 pm; edited 2 times in total |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2870
|
Posted: Tue Oct 27, 2020 1:13 am Post subject: |
|
|
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 |
|
|
teika Apprentice
Joined: 19 Feb 2011 Posts: 163 Location: YYYY-MM-DD, period. Have you ever used the Internet?
|
Posted: Sat Apr 15, 2023 1:43 am Post subject: |
|
|
Thanks. That workaround really helps.
(You're right. As you feared, my patch has to be updated now, and will need to be forever! ;-) |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2182
|
Posted: Sat Apr 15, 2023 10:07 am Post subject: |
|
|
RTFM?
Code: | quse --color firefox > q.lst |
produces coloured output for me.
I'm on portage-utils-0.95 _________________ Greybeard |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2870
|
|
Back to top |
|
|
teika Apprentice
Joined: 19 Feb 2011 Posts: 163 Location: YYYY-MM-DD, period. Have you ever used the Internet?
|
Posted: Sat Apr 15, 2023 1:04 pm Post subject: |
|
|
@Goverp, Ionen
Sorry & thanks for replying to my obsolete update (oxymoron?) m(_ _)m |
|
Back to top |
|
|
|