[HEADS UP] JLine 3 discussion

81 views
Skip to first unread message

Guillaume Nodet

unread,
Aug 28, 2015, 2:26:35 PM8/28/15
to jline...@googlegroups.com, jlin...@googlegroups.com
I've pushed a branch that could be the start of a JLine 3.0 line at 

You may not be able to compile it yet, as it requires some jansi additions that are not yet available, as I haven't find a way to push snapshots yet.
Anyway, here are the main changes:
  * full new API which mainly consists in Console (which provides a character based reader and writer) and Reader which provides the readLine() methods)
  * low level access to the posix console in native mode (the stty calls have been replaced with tcgetattr / tcsetattr native calls
    We should be able to provide back support to avoid native calls for those consoles, though the windows support will always require native calls
  * better non system console support (mostly for socket based consoles, either telnet or ssh for example)
    It supports either real posix consoles or an emulated console.
  * better support for signals
  * no static configuration

The switch to native calls is mainly for performance reasons, to avoid using exec() whenever we read the terminal size or attributes.  I don't see any problem in bringing back the previous method to avoid native calls.
Full access to console settings will allow fixing all the problems with echo, cr/lf, etc... by configuring the console correctly.
Low level streams access has been removed from the API, as the console is really a character based console, not a byte stream.

One possible improvement would be to merge Console and Reader so that Console would have readLine() methods and be compatible to the java 6 java.io.Console class.  The reason why I haven't done that yet is that while the Console has not much configuration, the Reader has a lot of options, so I'm not really sure if this is a good idea to do it or not.

I'll try to push jansi snapshots somewhere so that people can try it out.
Fwiw, it hasn't been much tested, so there's still a lot of bug fixing to do before it's in a real stable state.

I'm open to discuss any points and eager to ear suggestions...

Cheers,
Guillaume Nodet


--
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Reply all
Reply to author
Forward
0 new messages