[Pharo-project] Colored Stdout/Stderr logging with headless images

Camillo Bruni camillobruni at gmail.com
Tue Mar 6 08:12:18 EST 2012


I have a complete implementation of it ready together with a pure-st readline lib ;)
So when the time is ready I will integrate it :P


On 2012-03-06, at 13:59, Igor Stasenko wrote:

> On 6 March 2012 13:46, Stefan Marr <smalltalk at stefan-marr.de> wrote:
>> 
>> On 06 Mar 2012, at 13:18, Camillo Bruni wrote:
>> 
>>> actually its a bit of a hack :D (well the implementation not)
>>> 
>>> but the problem is, that we should properly detect if the terminal supports colors or not ;) otherwise you might get some ugly escape sequences :D
>> 
>> Do you know the tput tool?
>> 
>> I use it in my makefiles like this:
>>        START_BOLD=$(shell tput bold)
>>        STOP_BOLD=$(shell tput sgr0)
>> 
>> It gives you the supported escape sequence for a give style based on a database of terminals and your current environment.
>> 
> yeah, but that means that VM (or some plugin/prim) is needed to detect
> that it outputs to terminal,
> and not redirected to file or pipes output to another process.
> 
>> Best regards
>> Stefan
>> 
>> 
>> --
>> Stefan Marr
>> Software Languages Lab
>> Vrije Universiteit Brussel
>> Pleinlaan 2 / B-1050 Brussels / Belgium
>> http://soft.vub.ac.be/~smarr
>> Phone: +32 2 629 2974
>> Fax:   +32 2 629 3525
>> 
>> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko.
> 





More information about the Pharo-dev mailing list