public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] Terminal formatting and colors escape sequences
@ 2006-03-02 13:49 Bo Andresen
  2006-03-02 14:01 ` Bo Andresen
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Bo Andresen @ 2006-03-02 13:49 UTC (permalink / raw
  To: gentoo-user

I know this is very off topic, but I have no idea how to find a place where it 
actually is on topic.. so I'm posting it here.

I wish to be able to run a program (eix-sync/diff-eix) in cron that prints 
colors (with use of --force-color) and then send that colored output as a 
mail. In order to get colors in a mail a have to use html. If there exist a 
program that is capable of converting escape sequences used for formatting 
and coloring an xterm to html I would love to know about it. 

Otherwise I'll make it myself (with a very limited range of supported escape 
sequences). My problem is that I am unable to locate a reference that defines 
the escape sequences. Guessing by testing with xterm isn't really a optimal 
way to find out...

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] Terminal formatting and colors escape sequences
  2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
@ 2006-03-02 14:01 ` Bo Andresen
  2006-03-02 14:11 ` Jason Stubbs
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Bo Andresen @ 2006-03-02 14:01 UTC (permalink / raw
  To: gentoo-user

Just in case somebody wonders what I'm talking about here is an example (^[ is 
an escape character):

-------------------------------------------------------------------- 
^[[32;01m*^[[0m Running emerge --sync ...
^[[A^[[73G  ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m
 ^[[32;01m*^[[0m Running update-eix ...
^[[A^[[73G  ^[[34;01m[ ^[[32;01mok^[[34;01m ]^[[0m
--------------------------------------------------------------------

^[[32;01m = green
^[[0m = black
^[[73G = right justify
^[[34;01m = blue
^[[A = ?????

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] Terminal formatting and colors escape sequences
  2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
  2006-03-02 14:01 ` Bo Andresen
@ 2006-03-02 14:11 ` Jason Stubbs
  2006-03-02 14:56 ` Hans-Werner Hilse
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jason Stubbs @ 2006-03-02 14:11 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 March 2006 22:49, Bo Andresen wrote:
> My problem is that I am unable to locate a reference that defines 
> the escape sequences.

Google for "xterm escape sequences" yields many results. s/xterm/ansi/
for even more.

--
Jason Stubbs

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] Terminal formatting and colors escape sequences
  2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
  2006-03-02 14:01 ` Bo Andresen
  2006-03-02 14:11 ` Jason Stubbs
@ 2006-03-02 14:56 ` Hans-Werner Hilse
  2006-03-02 15:43   ` Bo Andresen
  2006-03-02 15:27 ` [gentoo-user] " Remy Blank
  2006-03-02 17:23 ` [gentoo-user] " Bo Andresen
  4 siblings, 1 reply; 8+ messages in thread
From: Hans-Werner Hilse @ 2006-03-02 14:56 UTC (permalink / raw
  To: gentoo-user

Hi,

On Thu, 2 Mar 2006 14:49:49 +0100 Bo Andresen <bo.andresen@gmail.com>
wrote:

> I wish to be able to run a program (eix-sync/diff-eix) in cron that
> prints colors (with use of --force-color) and then send that colored
> output as a mail. In order to get colors in a mail a have to use
> html. If there exist a program that is capable of converting escape
> sequences used for formatting and coloring an xterm to html I would
> love to know about it. 

I'd say, the Perl module HTML::FromANSI should do what you want
(available from cpan). It brings a script, ansi2html, that provides
access from the command line. Note that you might have to play with the
TERM environment variable.

-hwh
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-user]  Re: [OT] Terminal formatting and colors escape sequences
  2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
                   ` (2 preceding siblings ...)
  2006-03-02 14:56 ` Hans-Werner Hilse
@ 2006-03-02 15:27 ` Remy Blank
  2006-03-02 15:42   ` Bo Andresen
  2006-03-02 17:23 ` [gentoo-user] " Bo Andresen
  4 siblings, 1 reply; 8+ messages in thread
From: Remy Blank @ 2006-03-02 15:27 UTC (permalink / raw
  To: gentoo-user

Bo Andresen wrote:
> My problem is that I am unable to locate a reference that defines 
> the escape sequences. Guessing by testing with xterm isn't really a optimal 
> way to find out...

man console_codes

HTH.
-- Remy


Remove underscore and suffix in reply address for a timely response.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user]  Re: [OT] Terminal formatting and colors escape sequences
  2006-03-02 15:27 ` [gentoo-user] " Remy Blank
@ 2006-03-02 15:42   ` Bo Andresen
  0 siblings, 0 replies; 8+ messages in thread
From: Bo Andresen @ 2006-03-02 15:42 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 March 2006 16:27, Remy Blank wrote:
> > My problem is that I am unable to locate a reference that defines
> > the escape sequences. Guessing by testing with xterm isn't really a
> > optimal way to find out...
>
> man console_codes

Now that's the reference I was looking for. Thanks to everyone who 
responded. :)

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] Terminal formatting and colors escape sequences
  2006-03-02 14:56 ` Hans-Werner Hilse
@ 2006-03-02 15:43   ` Bo Andresen
  0 siblings, 0 replies; 8+ messages in thread
From: Bo Andresen @ 2006-03-02 15:43 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 March 2006 15:56, Hans-Werner Hilse wrote:
> I'd say, the Perl module HTML::FromANSI should do what you want
> (available from cpan). It brings a script, ansi2html, that provides
> access from the command line. Note that you might have to play with the
> TERM environment variable.

Sounds interesting. Unfortunately I don't know Perl but I think I'll have a 
look at it anyway... Thanks.

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] Terminal formatting and colors escape sequences
  2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
                   ` (3 preceding siblings ...)
  2006-03-02 15:27 ` [gentoo-user] " Remy Blank
@ 2006-03-02 17:23 ` Bo Andresen
  4 siblings, 0 replies; 8+ messages in thread
From: Bo Andresen @ 2006-03-02 17:23 UTC (permalink / raw
  To: gentoo-user

Does anyone know of I way in which to force emerge to show colors when piping 
the output to a file? I really could use a tip.

-- 
Bo Andresen
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-02 17:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02 13:49 [gentoo-user] [OT] Terminal formatting and colors escape sequences Bo Andresen
2006-03-02 14:01 ` Bo Andresen
2006-03-02 14:11 ` Jason Stubbs
2006-03-02 14:56 ` Hans-Werner Hilse
2006-03-02 15:43   ` Bo Andresen
2006-03-02 15:27 ` [gentoo-user] " Remy Blank
2006-03-02 15:42   ` Bo Andresen
2006-03-02 17:23 ` [gentoo-user] " Bo Andresen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox