Have some improvements on Windows: context

11 views
Skip to first unread message

Mihai Nita

unread,
Jan 3, 2012, 6:20:33 PM1/3/12
to jansi-dev

First: thanks a lot for you great library, saves me a lot of time!

I have started something similar, but Windows only (one can always use
ANSI strings on Mac/Linux).
I wanted to solve two main things: colored output, and better Unicode
output than the normal Java one.

Then I have found you wonderful library, cross-plarform, and solving a
big chunk of my problem.
And I noticed that you also added (recently)
org.fusesource.jansi.internal.WindowsSupport.writeConsole
But there is no way to determine if the output is redirected or not.
Hence this post :-)

Hiram Chirino

unread,
Jan 4, 2012, 5:00:37 AM1/4/12
to jans...@googlegroups.com
I think that when you try to writeConsole and your re-directing, the
API call fails and in turn generates an exception. It's been a while
since I've played with it tho, I might be wrong.

Regards,
Hiram

FuseSource
Web: http://fusesource.com/

Mihai Nita

unread,
Jan 4, 2012, 6:20:08 PM1/4/12
to jansi-dev
Nothing happens when you redirect (no output, but not exception
either)

The implementation I used in my (abandoned :-) library was using
- WriteConsole without redirect
- Java.out (with Java.setOut("utf-8") first) for redirected output
(hence the need for isatty)

Mihai
Reply all
Reply to author
Forward
0 new messages