Comments (13)
Thanks Martin.
Meantime I've confirmed it on Windows and Linux.
I have a fix, committed.
Will do a release soon.
from ansi-econsole.
Released
from ansi-econsole.
Tested, confirmed (at least on macOS)
from ansi-econsole.
Awesome, thanks for the quick turnaround, much appreciated.
from ansi-econsole.
Any updates on this? Is there already a release available that includes this?
from ansi-econsole.
Thank you, Mihai for the awesome plugin and Martin for fixing. Any good news on release date?
from ansi-econsole.
As a temporal quick-and-dirty solution until the new version of the plugin is released, I replaced the file AnsiConsolePageParticipant.class
in the net.mihai-nita.ansicon.plugin_1.4.4.202102040736.jar inside Eclipse with the new version from the main branch (which contains the fix). Copying without escape sequences does work now.
Tested with Eclipse 2021-06 and 2021-09. Compiled with AdoptOpenJDK-11.0.11+9.
Perhaps can be useful for someone.
Just replace the two jar files inside Eclipse plugins
folder with the attached ones: net.mihai-nita.ansicon.plugin_1.4.4.202102040736.patched.zip (extract them from zip since GitHub doesn't support uploading of jar files). Only one file (AnsiConsolePageParticipant) has been replaced in the jars, all others are untouched. The source-jar is just for the sake of completeness.
from ansi-econsole.
Hmm... Strange behavior with this patch. Having some output in the Ansi Console and clicking Ctrl+C on a selected text in any other Eclipse view (e.g. code editor, commit details in history) will copy the whole content of the console (or whatever is selected there) into clipboard.
Copying via "Copy" entry from the context menu (as opposed to Ctrl+C shortcut) works properly in other views, but copies with escape characters from Ansi Console.
from ansi-econsole.
My next try is to define a CopyWithoutEscapesHandler
(analogous to existing CopyWithEscapesHandler
but calling AnsiClipboardUtils.textToClipboard()
with true
parameter to remove escapes) and bind it to the button "Copy text without escapes" on the console toolbar. Not as convenient as using keyboard shortcuts, but at least I can now copy text from console without escapes.
A proper solution from my pov would be intercepting copying operation in the Console (and only there) if the AnsiConsole plugin is activated.
from ansi-econsole.
Unfortunately, the copying without escape characters (color codes) is not working in Eclipse 2022-09 (where ANSI Console is a default part of Eclipse). In the plugin v1.4.5 and Eclipse 2022-06, it was nicely working. How can we fix that?
from ansi-econsole.
@elab I would recommend to raise this as an enhancement request or bug against https://github.com/eclipse-platform/eclipse.platform.debug
from ansi-econsole.
Explaining why this does not work anymore, and the fact that it was intentional, not an accident
When I've integrated this to Eclipse they discovered that some of the things I was doing were not quite OK.
For example I was intercepting the standard copy to do a "copy without escapes"
They argued (fair enough) that people who install this plugin are people interested in it, and care about its features.
They are free to uninstall it if they don't like it.
And it is clear who's at fault :-)
But doing something like that in the standard Eclipse, for everybody, goes against the Eclipse UX guidelines.
(same complaints about other things I was doing, like adding icons on the console toolbar).
All valid, I am not complaining :-)
How to fix it
- You can copy using Ctrl+Insert instead of Ctrl+C (Command instead of Ctrl on MacOS)
That hotkey is in fact very old Copy hotkey (still works as Copy in standard OS widgets).
- If you want a different hotkey (Ctrl+Shift+C, or whatever) you can configure it
The Enable/Disable and Copy (with/without escapes) are standard Eclipse commands and you can assign whatever hotkeys yoo want.
Preferences -- General -- Keys and search for ANSI.
- File a bug / feature request as Martin suggested.
from ansi-econsole.
For the default copy behavior discussion during the integration see eclipse-platform/eclipse.platform.debug#57
Reading it again, it was not so much about strictly "don't hijack the standard copy", but mostly a mixture of technical limitations / my lack of knowledge.
The context menu "Copy" in the console didn't show the "Ctrl+C" binding anymore.
And I didn't know how to really replace that command, instead of just "steal the hotkey"
So I don't want to blame it on others...
I expect there will be some fine-tunning for the next few Eclipse versions...
Feedback from users (like you :-) would greatly help with the direction of these changes.
from ansi-econsole.
Related Issues (20)
- Installation error HOT 3
- Support for setting ANSI console enablement default from another Eclipse Plugin HOT 3
- Console hang issue and slow performance on Windows HOT 10
- Not working on eclipse kepler HOT 2
- Ansi Console catches CTRL+C HOT 9
- Menu -- Copy & context menu -- Copy should copy without escapes
- Dual / Relicence under EPL2.0 / Contribute to Eclipse HOT 30
- Full support for terminal ProgressBar HOT 1
- Parameter default values are not recognized HOT 1
- CDT default colors are lost HOT 9
- Console is not updated when a property change HOT 1
- Color errors with Project -- Build All HOT 3
- Changing C/C++ output text color breaks ansi-econsole HOT 2
- Escape code ignore sometimes HOT 3
- Eclipse 2022-06 HOT 9
- Detect Eclipse 2022-09 and warn to uninstall HOT 1
- Console prints some extended unicode glyphs as 'unknown' HOT 2
- installed it, enabled it, restarted eclipse multiple times and cannot get it to work HOT 1
- DepShield Deprecation Notice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansi-econsole.