|Moss Prescott||May 13, 2009 11:40 am|
|Weiqi Gao||May 13, 2009 12:55 pm|
|Weiqi Gao||May 13, 2009 1:53 pm|
|Moss Prescott||May 13, 2009 4:40 pm|
|Nicholas Riley||May 15, 2009 12:09 pm|
|Weiqi Gao||May 15, 2009 1:02 pm|
|Nicholas Riley||May 15, 2009 1:32 pm|
|Philip Jenvey||May 15, 2009 6:57 pm|
|Weiqi Gao||May 15, 2009 8:08 pm|
|Philip Jenvey||May 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|
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?
Weiqi Gao wrote:
Here's my modified version of the jython shell script:
My changes are limited to
1) the CP_DELIMITER change;
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.
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:
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.
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
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
_______________________________________________ Jython-users mailing list Jyth...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users