Eclipse under Linux

67 views
Skip to first unread message

Mark Lapointe

unread,
Mar 8, 2012, 12:17:36 PM3/8/12
to jansi-dev
Hello,

what has been the best way to use jansi under eclipse that will
actually show the colours?

Cheers,

Mark.

Hiram Chirino

unread,
Mar 8, 2012, 3:20:09 PM3/8/12
to jans...@googlegroups.com
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 :
But which hook's into Eclipse's terminal instead of the Win32 APIs.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

chi...@fusesource.com | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo




Mihai Nita

unread,
Mar 8, 2012, 5:17:19 PM3/8/12
to jans...@googlegroups.com
That would be so cool!
I have used Grep Console to colorize log4j output (http://marian.musgit.com/projects_grepconsole.php),
but a plugin doing the same for ANSI would be so much better :-)
But I am not really sure such a thing would belong with jansi.

Mihai Nita

unread,
Mar 13, 2012, 8:25:27 PM3/13/12
to jansi-dev
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/>*
>
> *
> *
>
> *
> *

Hiram Chirino

unread,
Mar 14, 2012, 6:41:32 AM3/14/12
to jans...@googlegroups.com
Awesome! Just spin up a new github project for the plugin!
--

Hiram Chirino

Software Fellow | FuseSource Corp.

chi...@fusesource.com | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo




Mihai Nita

unread,
Mar 15, 2012, 7:41:30 PM3/15/12
to jansi-dev
Now at http://www.mihai-nita.net/eclipse :-)
It works with the standard install/uninstall mechanisms.

I want to do some more fine tuning, but at this point it is pretty
stable and in decent shape.

Over the week-end I will try to put the code in GitHub, and (probably)
also move the installer there.

Cheers,
Mihai

Mihai Nita

unread,
Mar 28, 2012, 8:32:19 PM3/28/12
to jansi-dev
In GitHub now: http://github.com/mihnita/ansi-econsole
And a first draft, quick-and-dirty page at http://www.mihai-nita.net/eclipse.
Reply all
Reply to author
Forward
0 new messages