atom feed10 messages in net.sourceforge.lists.jython-usersRe: [Jython-users] 2.5rc2, cygwin, an...
FromSent OnAttachments
Moss PrescottMay 13, 2009 11:40 am 
Weiqi GaoMay 13, 2009 12:55 pm 
Weiqi GaoMay 13, 2009 1:53 pm 
Moss PrescottMay 13, 2009 4:40 pm 
Nicholas RileyMay 15, 2009 12:09 pm 
Weiqi GaoMay 15, 2009 1:02 pm 
Nicholas RileyMay 15, 2009 1:32 pm 
Philip JenveyMay 15, 2009 6:57 pm 
Weiqi GaoMay 15, 2009 8:08 pm 
Philip JenveyMay 15, 2009 10:15 pm 
Subject:Re: [Jython-users] 2.5rc2, cygwin, and JLine
From:Moss Prescott (mo@termalabs.com)
Date:May 13, 2009 4:40:00 pm
List:net.sourceforge.lists.jython-users

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?

- moss

Weiqi Gao wrote:

Here's my modified version of the jython shell script:

http://www.weiqigao.com/blog/files/jython

My changes are limited to

1) the CP_DELIMITER change;

2) bracketed the actuall java command with

stty -icanon min 1 -echo

and

stty icanon echo

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.

See:

http://jira.codehaus.org/browse/JRUBY-2675 http://jira.codehaus.org/browse/GROOVY-2584 http://sourceforge.net/tracker/index.php?func=detail&aid=1822900&group_id=64033&atid=506056 http://www.weiqigao.com/blog/2008/04/08/your_jirb_groovysh_and_clj_commands_doesnt_work_in_cygwin.html

for details.

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.

------------------------------------------------------------------------------ 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