mihnita / ansi-econsole

Eclipse plugin that understands ANSI escape sequences to color the Eclipse console output.
http://www.mihai-nita.net/java/
Other
91 stars 25 forks source link

Eclipse 2022-06 #82

Open jesusaplsoft opened 2 years ago

jesusaplsoft commented 2 years ago

I have installed new eclipse 2022-06 ond my Mac and Ansi console plugin does not work any more. It worked before using eclipse 2022-03.

mihnita commented 2 years ago

Sorry, but can you share any other details that can help me reproduce it?

How does it manifest? Shows the escape sequences? Crashes? What kind of project? C/C++ build console or run console? Maven build time or Java runtime output? Something else?

I have it installed and working on 2022-06 (official release) on Mac, Windows 11 and Linux (Debian and Ubuntu). And I've tried it on 2022-06 on M3 and RC1 before the final was released, to make sure I don't have any surprises.

Thank you, Mihai

mihnita commented 2 years ago

I think I know what you mean. It is about building C/C++ apps using Makefile (to the C++ build console)? The color are there at the first build, but not the the following ones. If you right-click the console and "Clear" it is colored again in the next run (but only once)

mihnita commented 2 years ago

Might be the same as https://github.com/mihnita/ansi-econsole/issues/79 ?

jesusaplsoft commented 2 years ago

This is a Java project.

The problem arises as I run junit test. Console shows escape sequences but not colors. As I said, Ansi console does not appear at Preferences. Next, I include xml log4j piece of code used to show colors:

\ \ \ \ </Appenders>

As I said before, this plugin works perfectly on Eclipse 2022-03

mihnita commented 2 years ago

I believe you that it does not work. But it works for me. And until I can reproduce it, there is no way for me to fix it. So, please help me reproduce it?

===

Ansi console does not appear at Preferences

To me that sounds like the plugin is not even installed?

If you go to "About Eclipse", "Installation Details", is "Ansi Console" listed in the first tab ("Installed software")? What version is the plugin?

Or, is there a difference in your Eclipse installs that you can think of? Maybe one is Java, the other one is C++? Or something similar? Anything that can help me?

===

I've created a small maven project that logs using log4j and with your exact configuration (see junit_log_err\src\main\resources\log4j2.xml)

And works for me (in 2022-06), on Mac, Windows, and Linux.

You can find that project here: https://mihai-nita.net/tmp/junit_log_err.zip

Can you please import it and try it? (File --> Import... --> Existing Maven projects)

===

If you create a small project (Java, or C/C++) and try to print "Hello \033[91mRED\033[m World!", does "RED" show in color?

anshITQA commented 2 years ago

Hey Mihnita, I am using 2022-03 and can not get it to work in console for my other programs too. I tried using a sample program with java and tried printing "Hello \033[91mRED\033[m World!", The "RED" does show in bold red color however so am not sure why it does not work with other programs... :( Here is my build info: Version: 2022-03 (4.23.0) Build id: 20220310-1457 The plugin is installed and enabled with std error setting checkbox as enabled too. Am on a windows 11 device.

jesusaplsoft commented 2 years ago

This is a Java project.

The problem arises as I run junit test. Console shows escape sequences but not colors. As I said, Ansi console does not appear at Preferences. Next, I include xml log4j piece of code used to show colors:

As I said before, this plugin works perfectly on Eclipse 2022-03 Best regards

El 30 jun 2022, a las 8:56 a. m., Mihai Nita @.***> escribió:

Might be the same as #79 https://github.com/mihnita/ansi-econsole/issues/79 ?

— Reply to this email directly, view it on GitHub https://github.com/mihnita/ansi-econsole/issues/82#issuecomment-1170891810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANXVPPWYQVSKANA4A4YH5LVRVHLRANCNFSM52B2X7FA. You are receiving this because you authored the thread.

mihnita commented 2 years ago

Sorry, I can't reproduce it.

I've tried it in 2022-03, 2022-06, and 2022-09 (no plugin, with the ANSI functionality that is not in Eclipse). And I did it on Win, Mac, Linux Plugin version 1.4.8.202208270854


This is very weird:

As I said, Ansi console does not appear at Preferences. and: The "RED" does show in bold red

I can't think of any way that these can't be both happen. If it is not in preferences, then it is not installed. But if the test app shows red, then it is installed.

Can you uninstall it and install it again? I know it sounds dumb, but I don't have any other idea.


Here is a minimal project I've created: https://github.com/mihnita/github_features

You should be able to

git clone https://github.com/mihnita/github_features.git

Then File -- Import... -- Maven -- Existing Maven Projects, select it, "Finish", and I get color logging no matter how I run it:

It is the exact appender you provided, I only had to change white2 to white


Trying to clarify something (not that it makes much of a difference, since I tried both 2022-03 and 2022-06) But what is it? Works in 2022-03 or not?

I have installed new eclipse 2022-06 ond my Mac and Ansi console plugin does not work any more. It worked before using eclipse 2022-03.

and

As I said before, this plugin works perfectly on Eclipse 2022-03

but then

I am using 2022-03 and can not get it to work in console for my other programs too. ... Here is my build info: Version: 2022-03 (4.23.0) Build id: 20220310-1457


Do you see the enable/disable icon in the corner of the console? Can you click it a few times and try running in both states?


Here is my output (Windows, Eclipse Version: 2022-03 (4.23.0), Build id: 20220310-1457, but works the same on MacOS)

image

mihnita commented 2 years ago

Another idea for something to try: can log some text with escapes? For example

logger.info("Hello \033[91mRED \033[92mGREEN \033[94mBLUE\033[m output");

This is what I get with disableAnsi="false":

image

And this is what I get with disableAnsi="true":

image

As you can see, that explicit output still works.

If that is what you see, then it is something with the logging, not with the plugin.