From: Charlie Groves <charlie.groves@gm...> - 2007-04-22 21:24:19
I moved to a new machine without Java readline support, so rather than
going through the hassle of building it I added JLine support to
Jython. It was definitely the right choice as writing that code was
much easier than building javareadline has been in my experience.
You get most of the normal readline stuff: Emacs like navigation on
the current line and up and down key history navigation.
Unfortunately it doesn't allow searching through the command history
To turn it on update to the latest code, add the latest JLine jar from
http://jline.sourceforge.net to your ant.properties, build, add
JLine's jar to your Jython classpath and add
-Dpython.console=org.python.util.JLineConsole to your Java invocation.
If you don't care about JLine, things should build just fine without
it. A lack of jline.jar in your ant.properties will cause a full
release build to fail though, just like missing any of the other
Adding tab completion support should be pretty simple. Just make an
implementation of JLine's Completer interfaces that hooks into the
completer from the rlcompleter module we're already including.
rlcompleter tries to connect to the readline module on import, so
we'll need to break that apart somehow, but that should be the only
tricky part. I think the actual complete function from it could be
made to work with the Completer interface easily.