Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to retain text color when doing a emerge --search |less?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
akhran
n00b
n00b


Joined: 25 Feb 2006
Posts: 17

PostPosted: Wed Mar 01, 2006 2:52 am    Post subject: How to retain text color when doing a emerge --search |less? Reply with quote

This may sound silly, but is there a way to retain the text color of the output when doing a package search with emerge when piped to 'less' as in

emerge --search packagename |less?

Many thanks !
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Wed Mar 01, 2006 5:01 am    Post subject: Reply with quote

After much digging, (silly, I know, but I found your question intriguing), I discovered that the emerge python script itself detects if you are outputting to a pipe instead of a tty. If so, it turns off all color. Therefore, unless you hack the emerge script, the answer is you can't. Which is silly since less -R will handle ansi color sequences.
Back to top
View user's profile Send private message
akhran
n00b
n00b


Joined: 25 Feb 2006
Posts: 17

PostPosted: Wed Mar 01, 2006 6:34 am    Post subject: Reply with quote

Do you mean that "emerge --search packagename |less -R" will show the output in color?

Btw, where is the emerge script located?


Thanks :)

yabbadabbadont wrote:
Which is silly since less -R will handle ansi color sequences.
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Wed Mar 01, 2006 7:12 am    Post subject: Reply with quote

Moved from Portage & Programming to Duplicate Threads.

See https://forums.gentoo.org/viewtopic-t-393802.html and/or https://forums.gentoo.org/viewtopic-t-384533.html
_________________
www.gentoo.org.au || #gentoo-au
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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