Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>UPDATE:</strong> I have sorted out the issue. It has to do with ANT giving escape sequences that while appropriate for a linux xterm, are NOT correctly interpreted by Mac OS X. It is possible to filter the ANT output to convert these sequences and restore colorized output.</p> <p>The moral of the story is that this wrapper script will achieve colorized output:</p> <pre> <b># cat /workspace/SDK/bin/ant-wrapper.sh</b> /usr/bin/ant -logger org.apache.tools.ant.listener.AnsiColorLogger "$@" | perl -pe 's/(?&lt=\e\[)2;//g' <b># alias ant='/workspace/SDK/bin/ant-wrapper.sh' </b> <b># ant publish </b> (output has lots of pretty colors; well, maybe not so pretty, more like an easter egg) </pre> <p><strong>Original Post (and debugging steps):</strong></p> <p>I'm having similar issues with regard to AnsiColorLogger not displaying colors at all. I'm not sure what the author means by "[output appears] for a second then it just disappears". That seems like a strange problem to occur on the Terminal.</p> <p>My Box:</p> <pre> # uname -a Darwin Dave-Dopsons-MacBook-Pro.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386 </pre> <p>This is the ANT Logger we are using: <a href="http://ant.apache.org/manual/listeners.html#AnsiColorLogger">http://ant.apache.org/manual/listeners.html#AnsiColorLogger</a></p> <p>Here's a related forum post (tried the advice given, to no avail): <a href="http://ant.1045680.n5.nabble.com/Macosx-and-AnsiColorLogger-td1355310.html">http://ant.1045680.n5.nabble.com/Macosx-and-AnsiColorLogger-td1355310.html</a></p> <p>I did "ant | less", and I DO see escape sequences, but still no colors: </p> <pre> Buildfile: /workspace/Words/words_blackberry/build.xml ESC[2;32m publish:ESC[m </pre> <p><strike>Still blocked on this, and would love advice if anyone has gotten it to work on OSX</strike></p> <p>GOT IT!</p> <p>So here's the output of colorized ls:</p> <pre> # CLICOLOR_FORCE=exfxcxdxbxegedabagacad ls -lGF | less total 112 -rw-r--r-- 1 ddopson admin 6511 May 29 12:41 build.xml drwxr-xr-x 6 ddopson admin 204 May 28 23:59 ESC[34meclipse-binESC[mESC[m/ lrwxr-xr-x 1 ddopson admin 35 May 23 21:24 ESC[35mfilesESC[mESC[m@ -> ../artwork/output/blackberry/files/ lrwxr-xr-x 1 ddopson admin 36 May 23 21:20 ESC[35mimagesESC[mESC[m@ -> ../artwork/output/blackberry/images/ </pre> <p>Notice how the escape sequences are subtly different; they don't have the '2;' like ANT did...</p> <p>So to test this theory: ant -logger org.apache.tools.ant.listener.AnsiColorLogger publish | sed 's/2;//g' </p> <p>... and the output is COLORIZED! Victory!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload