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.
ANSI support can't be disabled via product customization #63
While validating change in #60 I've stumbled over the fact that the "Enable ANSI Support" button in the Console view always shows wrong state. Turned out, the org.eclipse.ui.internal.console.ansi.commands.EnableDisableHandler.updateElement(UIElement, Map) always reads it's own default from plugin.xml (which is true) on first init and sets that default to the preferences... So I wasn't able to disable ANSI support via product preference org.eclipse.ui.console/ANSI_support_enabled=false as expected, because it was always overridden once Console was opened.
together with the style="toggle" on the menuContribution
and the command.getState(RegistryToggleState.STATE_ID); "magic"
So Eclipse itself did the "toggling", and it was only the first time coming from plugin.xml
The reason this was done is because Eclipse initialized the console "chrome", including the toolbar and the icons in the toolbar without calling any code in the plugin whatsoever.
So if the element.setChecked was left to updateElement, that only runs very late, when the first output goes to the console and the plugin was activated.
The visual effect was that if the plugin was disabled and you exited, the next time Eclipse started it was showing the icon enabled. Then you output something, the plugin is activated, the icon is updated (to "disabled" state), and the output was showing the escapes and no styles.
So the functionality was OK for the disabled state, but the icon was in enabled state until the first run.
Activity
Fix ANSI support EnableDisableHandler init
mihnita commentedon Aug 10, 2022
Actually, this is not true.
The stat is handled by Eclipse itself.
It is what this did:
together with the
style="toggle"on themenuContributionand the
command.getState(RegistryToggleState.STATE_ID);"magic"So Eclipse itself did the "toggling", and it was only the first time coming from
plugin.xmlThe reason this was done is because Eclipse initialized the console "chrome", including the toolbar and the icons in the toolbar without calling any code in the plugin whatsoever.
So if the
element.setCheckedwas left toupdateElement, that only runs very late, when the first output goes to the console and the plugin was activated.The visual effect was that if the plugin was disabled and you exited, the next time Eclipse started it was showing the icon enabled. Then you output something, the plugin is activated, the icon is updated (to "disabled" state), and the output was showing the escapes and no styles.
So the functionality was OK for the disabled state, but the icon was in enabled state until the first run.
All of that is "standard Eclipse magic"
This was the bug:
mihnita/ansi-econsole#45
mihnita commentedon Aug 10, 2022
That means the standard "toggle" mechanism provided by Eclipse is buggy.
Fix ANSI support EnableDisableHandler init