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:Weiqi Gao (
Date:May 15, 2009 1:02:27 pm

Nicholas Riley wrote:

In article <>, Weiqi Gao <> wrote:

2) bracketed the actuall java command with

stty -icanon min 1 -echo


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.

Unfortunately this breaks noninteractive use of Jython. For example, this should work:

% echo "print 'hello'" | ./jython hello

But with your copy of the shell script, I get:

% echo "print 'hello'" | ./jython stty: stdin isn't a terminal Jython 2.5rc2+ (trunk:6350, May 15 2009, 14:02:54) [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_07 Type "help", "copyright", "credits" or "license" for more information.

print 'hello'

hello stty: stdin isn't a terminal

Perhaps you could make the interactive changes dependent on whether stty succeeds? Also, the unconditional use of JLine means that the setting of python.console in the registry is ignored.

Maybe a non-solution solution is appropriate here: Let everything stand as is, and let Cygwin users be aware of the potential issues. It's been that way with many other software packages.

Here's what works for Cygwin users:

1. Use a DOS prompt and forget about the headaches of Cygwin. 2. Use Cygwin bash in a DOS window: jython.bat works there. 3. Use Cygwin xterm/rxvt/etc. with the modified jython script for interactive session and jython.bat (or unmodified jython) for non-interactive usage.

The ultimate solution of this problem would require two things:

1. Fix JLine so that it works with Cygwin xterm/rxvt/etc. 2. Fix Jython so that it uses the correct JLine Terminal under Cygwin.

2 should be easy, but 1 is tough. The JLine bug has been open for a year and a half now.

------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.