Something that pretty much work:
http://mihai-nita.net/tmp/net.mihai-nita.AnsiConsole_1.0.0.20120310.jar
Just drop it in the Eclipse plugins folder.
It only handles attribute changes.
For cursor positioning and so on it looks like normal Eclipse way to
do things gets in the way big time
(the output is processed line by line, with events).
So I did not even try.
Might be possible, but it would be pretty intrusive. And I am just
learning (in fact, this is my first Eclipse plugin).
Current issues: the background color is wrong in some situations
(when you specify bold/underline, but without a color, so you would
have to inherit the default console settings)
There is no clean way (that I could find) to get the background color,
so I have it as a setting for the plugin, for now.
Need to set it the same as the real console one.
Other things:
- I have a "Windows emulation way" that treats underscore/italic as
bright colors (vs. real bold/underscore)
- Option to select from some existing palettes (http://
en.wikipedia.org/wiki/ANSI_escape_code#Colors) not implemented
It was a fun week-end project, but I have to see where to go from here
(or even if it is worth going somewhere :-)
Do you see this as something that can be merged into jansi?
What I am thinking for now (good enough for me :-):
- put it in GitHub
- fix the bugs that I know about
- implement the palette selection (or not?)
- implement the one click enable/disable from the icon in the console
title
(there is an icon there already, sends events, but there is no
functionality implemented)
- package it nicely so that it look like standard plugin (can be
installed/uninstalled, about, legal notes, etc.)
- no plans to deal with cursor movement, erase screen, etc.
Mihai
On Mar 8, 1:20 pm, Hiram Chirino <
hi...@hiramchirino.com> wrote:
> I'd imagine you need to update's eclipse's console rendering code to
> interpret the ANSI escape sequences. Jansi includes some great base clases
> to help you do that. That's basically what the Windows handler is doing,
> interpreting the escape codes and then calling Win32 APIs to change the
> colors/move the cursor around. You would need to implement something like :
https://github.com/fusesource/jansi/blob/master/jansi/src/main/java/o...
> But which hook's into Eclipse's terminal instead of the Win32 APIs.
>
> On Thu, Mar 8, 2012 at 12:17 PM, Mark Lapointe <
m...@revynet.org> wrote:
> > Hello,
>
> > what has been the best way to use jansi under eclipse that will
> > actually show the colours?
>
> > Cheers,
>
> > Mark.
>
> --
>
> **
>
> *Hiram Chirino*
>
> *Software Fellow | FuseSource Corp.*
>
> *
chir...@fusesource.com |
fusesource.com*
>
> *skype: hiramchirino | twitter: @hiramchirino<
http://twitter.com/hiramchirino>
> *
>
> *blog: Hiram Chirino's Bit Mojo <
http://hiramchirino.com/blog/>*
>
> *
> *
>
> *
> *