You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Integrate in the ANSI Escapes in the Eclipse Console plugin #47
As a zeroth step we could consider to take the relevant projects as they are and commit them to the target repository referencing the originating repository-URL and commit-id a second commit could then the changes suggested by Christoph.
This way we should trace 100% of the changes.
Contributed code should be "copied" without the history if migrating code to eclipse.
You fork that repository, put your bundles in and transform to the eclipse namespace, this should include AnsiConFeature, AnsiConsole and AnsiConTest
integrate them in the build and make sure it succeeds (let us know if you need any help with that!)
You open a PR to merge your code (link this issue as well)
the we will open a CQ for approval as your contribution is >1000 LOC and contains content not only created by you
It hopefully will be approved, we can merge and further proceed / decide / integrate, I think a first step would be to include this then in the usual EPPs gather feedback and fix bugs and then we might change the "standard" console to have ANSI on by default.
From Platform POV, I don't think we'll merge in code that create new plugins for that feature. Code should be directly integrated into the existing org.eclipse.ui.console plugin and tests in the existing org.eclipse.debug.tests; a new feature is not necessary.
This was the proposal from laeubi to mihnita/ansi-econsole#70 (comment): "A separate plugin would make sense here, we can move the code around later if desired, but that way one can 'opt-in' for a while to include ANSI or not."
I have no opinion, you guys know better. Whatever you decide, I'll do.
Maybe it is just a bad naming of the issue?
Feel free to change it, if the current one is confusing.
@mickaelistria the idea was that the EPP can choose if ANSI should be used / activated or not. If later we decide that it should be the default, code code be moved around without a problem I think.
the idea was that the EPP can choose if ANSI should be used / activated or not.
That can be covered by a preference; and this preference already exists in the contributed code, so I don't think we need more isolation to have ability to control enablement.
If later we decide that it should be the default, code code be moved around without a problem I think.
It's more work overall, scattered in several places, and doesn't deliver the value to all users (not everyone uses EPP).
Here we're talking about ~30 internal classes, the move may not be too hard. I think it will bring the best ROI by fully integrating it directly in org.eclipse.ui.console.
the idea was that the EPP can choose if ANSI should be used / activated or not.
That can be covered by a preference; and this preference already exists in the contributed code, so I don't think we need more isolation to have ability to control enablement.
If later we decide that it should be the default, code code be moved around without a problem I think.
It's more work overall, scattered in several places, and doesn't deliver the value to all users (not everyone uses EPP). Here we're talking about ~30 internal classes, the move may not be too hard. I think it will bring the best ROI by fully integrating it directly in org.eclipse.ui.console.
Yes, a separate package in org.eclipse.ui.console will be enough for isolation.
the idea was that the EPP can choose if ANSI should be used / activated or not.
That can be covered by a preference; and this preference already exists in the contributed code, so I don't think we need more isolation to have ability to control enablement.
If later we decide that it should be the default, code code be moved around without a problem I think.
It's more work overall, scattered in several places, and doesn't deliver the value to all users (not everyone uses EPP). Here we're talking about ~30 internal classes, the move may not be too hard. I think it will bring the best ROI by fully integrating it directly in org.eclipse.ui.console.
Mickael's arguments are reasonable for me.
And given that in the end the goal is to have it integrated tightly, adding it directly to suitable Eclipse plug-ins seams reasonable and save one step leter. Furthermore the ANSI-Console is a mature and long lasting project so I don't expect many problems with it and we are relatively early in the release cycle and therefore have a lot of time to find the ingeration issues.
I suggest for the very first commit you copy the required class to suitable existing plugins but with the same packages as they are now (and add the URL+commitID of the original). In a second commit you rename the packages to match the names of the other packages in those plug-ins (i.e. org.eclipse...) and then in a third commit 'connect' the new classes with the existing console infra-structure. E.g. add the new preference-entries/pages, remove now unused/invalid elements, fix compile errors etc.
I don't think we need to "record" all this intermediate steps at all if we not plan to merge these three commits as is. So maybe just copy and adjust the code in one commit would be perfectly fine.
I don't think we need to "record" all this intermediate steps at all if we not plan to merge these three commits as is. So maybe just copy and adjust the code in one commit would be perfectly fine.
I don't think we need to "record" all this intermediate steps at all if we not plan to merge these three commits as is. So maybe just copy and adjust the code in one commit would be perfectly fine.
Since it is done anyway I think it wouldn't be bad to hit commit in between, but of course it also can be done as one commit.
Some items that I thought about and I don't want to be lost.
Might open issues for some of them?
Or if there is a place for documentation.
But for now:
Big limitation: because it implements LineStyleListener, all it can do is take one line of text and return styles.
It means it can't change anything, no cursor positioning, no screen erase, scrolling, etc.
Add tests
where: under org.eclipse.debug.tests.console
how: ???
Commands added in the right click after may be Word Wrap
TBD what commands. Just enable / disable? Or also copy with / without escapes?
Performance tests & warnings: should we keep them? => Removed
Should we also change the Eclipse defaults?
Remove "stderr" option? Make it non-optional.
Works pretty well, no complaints, not bugs.
Add test for the Eclipse Ansi Console in the Ansi Console Plugin.
Detect the duplication and instruct the users to unistall the plugin.
Some re-org, to make things more like the rest of Eclipse.
For example move some of the declarations from org.eclipse.ui.console/plugin.xml to org.eclipse.debug.ui/plugin.xml
"Branding" (?) (change "Ansi Console" in UI, maybe class names?)
Things I would like to contribute to Eclipse itself:
Apply the "hack" that fixes the RTF for both Mac and Linux and Win
See AnsiClipboardUtils, ESCAPE_SEQUENCE_REGEX_RTF_FIX_SRC & ESCAPE_SEQUENCE_REGEX_RTF_FIX_TRG.
HTML in clipboard
Performance for documents with many positions, especially when the console buffered is trimmed.
Testing: I probably need some help to decide how to do it.
This is a lot about look. How to test that the output looks good?
Ideas:
Output, then for each line in the StylesText save the List<StyleRange> and compare against some golden files
Output, then copy to clipboard, save the result to a file and compare against some golden files
Screenshots, compare against some golden files
None of these is perfect.
For all options: the output can only capture the line ranges still in the control. The lines that are pushed out (because of the small buffer) are not captured.
And some of the bugs fixed (both functionality and performance) show exactly when the buffer is small.
So there is no way that I know of to test that.
Option 2 depends on how the styles are mapped to the clipboard format. Right now the only clipboard format supported is RTF. Any changes in the RTFWriter would break these tests,
Neither 1 nor 2 don't really capture the visual rendering.
Option 3 is the method I use for my standalone plugin.
But requires some plugin to do the screen capture of the widget and save to images.
It is half-manual (a loop running a small test, capture, clear screen)
And requires exact match of the configuration: same OS, same font versions, some theme / font / font size, some size of the console widget.
TLDR: I need some help from someone more familiar with good testing practices for Eclipse.
This should be included for 4.25 M3 N&N item. [email protected]:eclipse-platform/www.eclipse.org-eclipse-news.git @mihnita please create a PR to describe the feature in N&N.
Activity
mihnita commentedon Jun 30, 2022
This will bring in the plugin from https://github.com/mihnita/ansi-econsole
The initial work was tracked by mihnita/ansi-econsole#70
That issue addressed licensing, and the big picture plan (copy, merging several comments):
This way we should trace 100% of the changes.
Contributed code should be "copied" without the history if migrating code to eclipse.
mickaelistria commentedon Jun 30, 2022
From Platform POV, I don't think we'll merge in code that create new plugins for that feature. Code should be directly integrated into the existing org.eclipse.ui.console plugin and tests in the existing org.eclipse.debug.tests; a new feature is not necessary.
mihnita commentedon Jun 30, 2022
This was the proposal from laeubi to mihnita/ansi-econsole#70 (comment):
"A separate plugin would make sense here, we can move the code around later if desired, but that way one can 'opt-in' for a while to include ANSI or not."
I have no opinion, you guys know better. Whatever you decide, I'll do.
Maybe it is just a bad naming of the issue?
Feel free to change it, if the current one is confusing.
laeubi commentedon Jun 30, 2022
@mickaelistria the idea was that the EPP can choose if ANSI should be used / activated or not. If later we decide that it should be the default, code code be moved around without a problem I think.
mickaelistria commentedon Jun 30, 2022
That can be covered by a preference; and this preference already exists in the contributed code, so I don't think we need more isolation to have ability to control enablement.
It's more work overall, scattered in several places, and doesn't deliver the value to all users (not everyone uses EPP).
Here we're talking about ~30 internal classes, the move may not be too hard. I think it will bring the best ROI by fully integrating it directly in org.eclipse.ui.console.
SarikaSinha commentedon Jun 30, 2022
Yes, a separate package in org.eclipse.ui.console will be enough for isolation.
HannesWell commentedon Jun 30, 2022
Mickael's arguments are reasonable for me.
And given that in the end the goal is to have it integrated tightly, adding it directly to suitable Eclipse plug-ins seams reasonable and save one step leter. Furthermore the ANSI-Console is a mature and long lasting project so I don't expect many problems with it and we are relatively early in the release cycle and therefore have a lot of time to find the ingeration issues.
I suggest for the very first commit you copy the required class to suitable existing plugins but with the same packages as they are now (and add the URL+commitID of the original). In a second commit you rename the packages to match the names of the other packages in those plug-ins (i.e.
org.eclipse...) and then in a third commit 'connect' the new classes with the existing console infra-structure. E.g. add the new preference-entries/pages, remove now unused/invalid elements, fix compile errors etc.laeubi commentedon Jun 30, 2022
I don't think we need to "record" all this intermediate steps at all if we not plan to merge these three commits as is. So maybe just copy and adjust the code in one commit would be perfectly fine.
mickaelistria commentedon Jun 30, 2022
+1
HannesWell commentedon Jun 30, 2022
Since it is done anyway I think it wouldn't be bad to hit
commitin between, but of course it also can be done as one commit.mihnita commentedon Jul 5, 2022
Some items that I thought about and I don't want to be lost.
Might open issues for some of them?
Or if there is a place for documentation.
But for now:
Big limitation: because it implements
LineStyleListener, all it can do is take one line of text and return styles.It means it can't change anything, no cursor positioning, no screen erase, scrolling, etc.
Known bugs
Console hang issue and slow performance on Windows mihnita/ansi-econsole#66
Changing C/C++ output text color breaks ansi-econsole mihnita/ansi-econsole#79
Escape code ignore sometimes mihnita/ansi-econsole#80
TODOs
where: under
org.eclipse.debug.tests.consolehow: ???
TBD what commands. Just enable / disable? Or also copy with / without escapes?
Should we also change the Eclipse defaults?
Works pretty well, no complaints, not bugs.
Detect the duplication and instruct the users to unistall the plugin.
For example move some of the declarations from
org.eclipse.ui.console/plugin.xmltoorg.eclipse.debug.ui/plugin.xmlThings I would like to contribute to Eclipse itself:
See
AnsiClipboardUtils,ESCAPE_SEQUENCE_REGEX_RTF_FIX_SRC&ESCAPE_SEQUENCE_REGEX_RTF_FIX_TRG.laeubi commentedon Jul 5, 2022
@mihnita I think once the console it integrated in eclipse it is perfectly valid to migrate the issues here.
mihnita commentedon Aug 4, 2022
Testing: I probably need some help to decide how to do it.
This is a lot about look. How to test that the output looks good?
Ideas:
StylesTextsave theList<StyleRange>and compare against some golden filesNone of these is perfect.
For all options: the output can only capture the line ranges still in the control. The lines that are pushed out (because of the small buffer) are not captured.
And some of the bugs fixed (both functionality and performance) show exactly when the buffer is small.
So there is no way that I know of to test that.
Option 2 depends on how the styles are mapped to the clipboard format. Right now the only clipboard format supported is RTF. Any changes in the
RTFWriterwould break these tests,Neither 1 nor 2 don't really capture the visual rendering.
Option 3 is the method I use for my standalone plugin.
But requires some plugin to do the screen capture of the widget and save to images.
It is half-manual (a loop running a small test, capture, clear screen)
And requires exact match of the configuration: same OS, same font versions, some theme / font / font size, some size of the console widget.
TLDR: I need some help from someone more familiar with good testing practices for Eclipse.
SarikaSinha commentedon Aug 4, 2022
This should be included for 4.25 M3 N&N item.
[email protected]:eclipse-platform/www.eclipse.org-eclipse-news.git
@mihnita please create a PR to describe the feature in N&N.
mihnita commentedon Aug 5, 2022
@SarikaSinha : PR created, eclipse-platform/www.eclipse.org-eclipse-news#49
Not sure if you are added as reviewer automatically or not.
Better safe than sorry.
SarikaSinha commentedon Aug 5, 2022
For Documentation :
[email protected]:eclipse-platform/eclipse.platform.common.git
Details can be added here : https://github.com/eclipse-platform/eclipse.platform.common/tree/master/bundles/org.eclipse.platform.doc.isv/guide
mihnita commentedon Aug 5, 2022
Thanks, will do
M.
laeubi commentedon Aug 8, 2022
Some usability problems are reported here: #57