Ticket #222 (closed defect: fixed)
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
Change History
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@…>
-
attachment
phing.with.dim.PNG
added
With dim turned on
Changed 4 years ago by Bruce Weirdan <weirdan@…>
-
attachment
phing.without.dim.PNG
added
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
36 36 # 37 37 #################################################### 38 38 39 AnsiColorLogger.ERROR_COLOR= 2;3140 AnsiColorLogger.WARNING_COLOR= 2;3541 AnsiColorLogger.INFO_COLOR= 2;3642 AnsiColorLogger.VERBOSE_COLOR= 2;3243 AnsiColorLogger.DEBUG_COLOR= 2;3439 AnsiColorLogger.ERROR_COLOR=01;31 40 AnsiColorLogger.WARNING_COLOR=01;35 41 AnsiColorLogger.INFO_COLOR=00;36 42 AnsiColorLogger.VERBOSE_COLOR=00;32 43 AnsiColorLogger.DEBUG_COLOR=01;34

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