i am using system.out
Thanks From Peter ________________________________ From: Emilian Bold <[email protected]> Sent: Friday, May 25, 2018 1:02:26 AM To: [email protected] Subject: Re: output window coloring question Maven is being executed as an external process which writes to a terminal. NetBeans has a basic VT100 terminal that probably takes care of some colors. My guess is you are writing to the InputOutput stream which has no official ANSI support except via IOColorLines.println which accepts a Color argument. --emi �\�\�\�\�\�\�\ Original Message �\�\�\�\�\�\�\ On 24 May 2018 7:54 PM, Peter Cheung <[email protected]> wrote: > Hi > > i saw maven can print colored text in output window, after hacking maven, i > know it uses library "org.fusesource.jansi.Ansi" to print colored text, but > my testing program still can't see any color. The most amazing thing is that > : in the output window, maven's text has color, but just my text has no > color. Any hints? > > my testing program: > > import org.junit.Test; > > import static org.fusesource.jansi.Ansi.;import static > org.fusesource.jansi.Ansi.Color.; > > import org.fusesource.jansi.AnsiConsole; > > public class TestConsole { > > @Test > > public void test() throws Exception { > > // String ANSI_RESET = "\u001B[0m"; > > // String ANSI_RED = "\u001B[31m"; > > // System.out.print(ANSI_RED + "XX"); > > // System.out.flush(); > > // System.out.println(ANSI_RESET); > > // System.out.println("\033[31;1mHello\033[0m, \033[32;1;2mworld!\033[0m"); > > // System.out.println((char) 27 + "[31m" + "ERROR MESSAGE IN RED"); > > // System.out.println((char) 27 + "[33mYELLOW"); > > AnsiConsole.systemInstall(); > > System.out.println(ansi().eraseScreen().fg(RED).a("Hello").fg(GREEN).a(" > World").reset()); > > } > > } > > Thanks > > From Peter --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
