Modify

Ticket #222 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

Terminal output dissapears and/or changes color

Reported by: watermark.nielsen@… Owned by: hans
Priority: major Milestone: 2.4.0RC1
Component: phing-core Version: 2.3.0
Keywords: Cc:

Description

I'm running phing on OS X Leopard via the Terminal.app and when phing targets are executed, the output disappears and can reappear via clicking randomly on where the output should be. Also, the text can change to a brown/bronze color.

When I piped the output to a text editor, I found that some strange characters were being outputted around the lines:

  • [2;36m
  • [2;32m
  • [m

In front of all three of those is a odd character that does not copy/paste well. In TextMate, it shows up as a light gray diamond (Default text color is black). I think it just doesn't know what it is at all.

Anyways, somewhere in the code, these characters are being added. I suspect it might be when a variable is casted to a string.

Attachments

phing.with.dim.PNG Download (33.7 KB) - added by Bruce Weirdan <weirdan@…> 4 years ago.
With dim turned on
phing.without.dim.PNG Download (32.9 KB) - added by Bruce Weirdan <weirdan@…> 4 years ago.
With dim turned off

Change History

comment:1 Changed 4 years ago by anonymous

Please let me know of the fix, as I need to fix it in our repository (we have a phing vendor branch).

comment:2 Changed 4 years ago by david

2 means dim color. the colors are defined in source:/branches/2.3/classes/phing/listener/defaults.properties@355

I guess they are pretty wrong either way, as errors or warnings should be bright, for instance. So we could change the attributes to default to 0, and use 1 (bright/bold) for errors and warnings?

(just tested, 0 and 1 seem to work fine, 2 is wonky on Terminal.app in OS X 10.5.2)

comment:3 Changed 4 years ago by anonymous

I'm still experiencing same problems with all of those defaults set to 0. Is there a way to disable the coloring entirely?

comment:4 Changed 4 years ago by anonymous

I found that if I changed

-logger phing.listener.AnsiColorLogger

To

-logger phing.listener.DefaultLogger

In bin/phing on line 83 then that avoids using the AnsiColor output.

comment:5 Changed 4 years ago by hans

If you're still seeing the odd behavior with defaults set to 0, make sure you're using latest SVN version. There was a bug where the logger wasn't picking up the color properties file.

comment:6 Changed 4 years ago by hans

Oh, and you can modify your "phing" shell script to change the AnsiColorLogger, so you don't have to specify it every time on the commandline.

comment:7 Changed 4 years ago by anonymous

Thanks for the responses Hans. I think I'll go with the phing shell script fix for now until a new version of phing has been released.

I don't know if you want to move forward with changing the default attributes to 0 or 1 instead of 2 to make it more compatible with Terminal.app, but at least now I know where I can modify them myself.

comment:8 Changed 4 years ago by Bruce Weirdan <weirdan@…>

Here's another problem with ATTR_DIM - it causes colored output to be underlined (see attached screenshot) when shell is ran via screen command. I found that removing attributes from color codes altogether solves this issue.

Changed 4 years ago by Bruce Weirdan <weirdan@…>

With dim turned on

Changed 4 years ago by Bruce Weirdan <weirdan@…>

With dim turned off

comment:9 Changed 3 years ago by mrook

  • Status changed from new to closed
  • Resolution set to fixed

This was fixed in r436.

comment:10 Changed 2 years ago by LanceRushing@…

Still and issue in SVN trunk rev 529

I poked around and found the fix:

  • classes/phing/listener/defaults.properties

     
    3636# 
    3737#################################################### 
    3838 
    39 AnsiColorLogger.ERROR_COLOR=2;31 
    40 AnsiColorLogger.WARNING_COLOR=2;35 
    41 AnsiColorLogger.INFO_COLOR=2;36 
    42 AnsiColorLogger.VERBOSE_COLOR=2;32 
    43 AnsiColorLogger.DEBUG_COLOR=2;34 
     39AnsiColorLogger.ERROR_COLOR=01;31 
     40AnsiColorLogger.WARNING_COLOR=01;35 
     41AnsiColorLogger.INFO_COLOR=00;36 
     42AnsiColorLogger.VERBOSE_COLOR=00;32 
     43AnsiColorLogger.DEBUG_COLOR=01;34 

comment:11 Changed 2 years ago by mrook

(In [530]) Refs #222 - really fix ANSI logging on OS X

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.