Skip Menu |

This queue is for tickets about the ANSIColor CPAN distribution.

Maintainer(s)' notes

This queue is obsolete. Please use the Term-ANSIColor queue instead.

Report information
The Basics
Id: 29091
Status: resolved
Priority: 0/
Queue: ANSIColor

People
Owner: Nobody in particular
Requestors: whatever [...] davidnicol.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.12
Fixed in: 2.00



Subject: keep track of state towards a local RESET
RESET sets back to black on white. It would be nice to be able to stack what the color set currently is, so if my output is all on green background, I could do something like print PUSHCOLOR ON_MAGENTA; warn "this line will be in magenta"; print POPCOLOR; warn "now we are back to what we were before"; and "now we are back to what we were before at eval line 4" would be on green instead of on white. I think this could be accomplished easily by appending everything to a string that is reset to '' on RESET, and stored or retrieved to an array on PUSHCOLOR and POPCOLOR.
Subject: Re: [rt.cpan.org #29091] keep track of state towards a local RESET
Date: Mon, 03 Sep 2007 22:23:48 -0700
To: bug-ANSIColor [...] rt.cpan.org
From: Russ Allbery <rra [...] stanford.edu>
"David Nicol via RT" <bug-ANSIColor@rt.cpan.org> writes: Show quoted text
> Fri Aug 31 18:09:04 2007: Request 29091 was acted upon. > Transaction: Ticket created by DAVIDNICO > Queue: ANSIColor > Subject: keep track of state towards a local RESET > Broken in: 1.12 > Severity: Normal > Owner: Nobody > Requestors: whatever@davidnicol.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29091 >
Show quoted text
> RESET sets back to black on white. It would be nice to be > able to stack what the color set currently is, so if my output > is all on green background, I could do something like
Show quoted text
> print PUSHCOLOR ON_MAGENTA; > warn "this line will be in magenta"; > print POPCOLOR; > warn "now we are back to what we were before";
Show quoted text
> and "now we are back to what we were before at eval line 4" > would be on green instead of on white.
Show quoted text
> I think this could be accomplished easily by appending everything to > a string that is reset to '' on RESET, and stored or retrieved > to an array on PUSHCOLOR and POPCOLOR.
Looks like a good idea to me. I'll include this in the next release. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Support for stacking colors in Term::ANSIColor was included in the 2.00 release.