Thanks, Weiqi. That was extremely helpful. I made most of your suggested
modifications and it now seems to be working as it should.

It seems like using jline.UnixTerminal fixed the most serious issue with
input getting garbled. I left out "-i" because I'd like to be able to
run a script the normal way and it's not really a big deal, but it would
be nice to figure that one out, too.

One question: are any of these changes incompatible with running scripts
non-interactively? It seems to work, but I wonder if using
InteractiveConsole is going to cause any problems.

I'll try it this way for a while and see if there are any other issues.
If it works out, maybe someone has a brilliant idea about how to make
something like this part of the Windows install?

3) modified the java command line to run "jline.ConsoleRunner
org.python.util.jython" instead of "org.python.util.jython";

4) added two properties to the java command line:
"-Dpython.console=org.python.util.InteractiveConsole" and
"-Djline.terminal=jline.UnixTerminal";

5) added "-i" to JYTHON_OPTS so that the prompts gets printed.

I have verified that this works in one of my Cygwin xterms. I can do
bash/emacs-style command line editing (C-a/C-e, C-f/C-b, C-p/C-n)
without any problems. The Home, End, and Arrow keys also work as expected.

Weiqi Gao wrote:

I'm seeing all the problems that you describe. If you select to install
the source, then you can fish out the jython shell script from the
src/shell/ directory. Copy it into the bin/ directory and change the
line that says:

CP_DELIMITER=":"

into

CP_DELIMITER=";"

and the script is good to go.

I use jython from a Cygwin xterm and in general JLine's
jline.WindowsTerminal does not work there. The jline.UnixTerminal can
be made to work in Cygwin xterm. And I've made tweaks to JRuby, Groovy,
and Clojure startup script so that command line editing is possible for
me with these languages.

The garbled edits that you see are most likely caused by the use of
jline.WindowsTerminal inside a Cygwin xterm.

And yes, there are other Cygwin users out there, some of us use Jython.

--
terma | software labs

Moss Prescott
303.417.1718 x207

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com