Giter Site home page Giter Site logo

Comments (13)

mihnita avatar mihnita commented on June 12, 2024 3

Thanks Martin.

Meantime I've confirmed it on Windows and Linux.
I have a fix, committed.
Will do a release soon.

from ansi-econsole.

mihnita avatar mihnita commented on June 12, 2024 1

Released

from ansi-econsole.

mihnita avatar mihnita commented on June 12, 2024

Tested, confirmed (at least on macOS)

from ansi-econsole.

martinlippert avatar martinlippert commented on June 12, 2024

Awesome, thanks for the quick turnaround, much appreciated.

from ansi-econsole.

martinlippert avatar martinlippert commented on June 12, 2024

Any updates on this? Is there already a release available that includes this?

from ansi-econsole.

elab avatar elab commented on June 12, 2024

Thank you, Mihai for the awesome plugin and Martin for fixing. Any good news on release date?

from ansi-econsole.

elab avatar elab commented on June 12, 2024

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.

elab avatar elab commented on June 12, 2024

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.

elab avatar elab commented on June 12, 2024

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.

elab avatar elab commented on June 12, 2024

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.

martinlippert avatar martinlippert commented on June 12, 2024

@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.

mihnita avatar mihnita commented on June 12, 2024

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

  1. 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).

  1. 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.

  1. File a bug / feature request as Martin suggested.

from ansi-econsole.

mihnita avatar mihnita commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.