groovy

Can't get groovysh to run in a cygwin xterm under Windows XP.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.2, 1.5.4
  • Fix Version/s: 1.5.5
  • Component/s: Groovysh
  • Labels:
    None
  • Environment:
    Windows XP Professional, SP2. 2G Ram, Pentium E2140. Cygwin GNU bash, version 3.2.33(18)-release (i686-pc-cygwin).
  • Number of attachments :
    0

Description

Groovysh loads ok in the xterm. If I attempt to do anything at the groovysh (enter key, help, any command), there is no response. Ctrl-C will exit the groovysh and then the bash shell will attempt to execute the command entered as a shell command.

I have the readline library installed in cygwin. Behavior was the same whether I used groovy 1.5.4 installed manually from the binary.zip file or whether I used the windows native installer. Groovysh does work properly in a windows cmd.exe window.

Activity

Hide
Kevin Slater added a comment -

in a cygwin xterm I had to invoke groovysh with the --terminal=none option. I don't know what functionality this might eliminate, but it works.

Show
Kevin Slater added a comment - in a cygwin xterm I had to invoke groovysh with the --terminal=none option. I don't know what functionality this might eliminate, but it works.
Hide
Paul King added a comment -

Hi Kevin, probably not relevant but what version of Java are you using? It might help when I try to replicate the issue when I get a chance.

Show
Paul King added a comment - Hi Kevin, probably not relevant but what version of Java are you using? It might help when I try to replicate the issue when I get a chance.
Hide
Kevin Slater added a comment -

Paul - sorry, I really meant to include that in the original bug. It was jdk 1.6.0_0_4. I chatted with Guillaume briefly this afternoon and he suggested that maybe this should be reopened since the JLine stuff doesn't work if you invoke groovysh with the --terminal=none option.

Show
Kevin Slater added a comment - Paul - sorry, I really meant to include that in the original bug. It was jdk 1.6.0_0_4. I chatted with Guillaume briefly this afternoon and he suggested that maybe this should be reopened since the JLine stuff doesn't work if you invoke groovysh with the --terminal=none option.
Hide
Paul King added a comment -

close off release 1.5.4

Show
Paul King added a comment - close off release 1.5.4
Hide
Paul King added a comment -

For the mailing list:

If I invoke groovysh under cygwin on Windows XP with the --terminal=none, it does work. But you lose all line editing goodness. I've pasted two different invocations of groovysh to show the difference in behavior:

kslater@IT026 ~
$ groovysh
Groovy Shell (1.5.4, JVM: 10.0-b19)
Type 'help' or '\h' for help.

groovy:000> show variables
[Ctrl-C pressed here by user]

kslater@IT026 ~
$ show variables
bash: show: command not found
kslater@IT026 ~
$ groovysh --terminal=NONE
Groovy Shell (1.5.4, JVM: 10.0-b19)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> show variables
No variables defined
groovy:000> exit

kslater@IT026 ~

Notice that in the first case the groovysh interpreter just hangs when I hit enter after asking it to show variables. Ctrl-C breaks out of it and then the cygwin bash shell tries to interpret that line. When invoked with --terminal=NONE things work, but with no line editing capability.

Show
Paul King added a comment - For the mailing list: If I invoke groovysh under cygwin on Windows XP with the --terminal=none, it does work. But you lose all line editing goodness. I've pasted two different invocations of groovysh to show the difference in behavior:
kslater@IT026 ~
$ groovysh
Groovy Shell (1.5.4, JVM: 10.0-b19)
Type 'help' or '\h' for help.

groovy:000> show variables
[Ctrl-C pressed here by user]

kslater@IT026 ~
$ show variables
bash: show: command not found
kslater@IT026 ~
$ groovysh --terminal=NONE
Groovy Shell (1.5.4, JVM: 10.0-b19)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> show variables
No variables defined
groovy:000> exit

kslater@IT026 ~
Notice that in the first case the groovysh interpreter just hangs when I hit enter after asking it to show variables. Ctrl-C breaks out of it and then the cygwin bash shell tries to interpret that line. When invoked with --terminal=NONE things work, but with no line editing capability.
Hide
Paul King added a comment -

Reopened as per mailing list

Show
Paul King added a comment - Reopened as per mailing list
Hide
Paul King added a comment -

bump fix version (targetting 1.5.5 but can be pushed if it turns out to be due to third party jar issues)

Show
Paul King added a comment - bump fix version (targetting 1.5.5 but can be pushed if it turns out to be due to third party jar issues)
Hide
Paul King added a comment - - edited

Using the latest 1.5.5 snapshot which has an updated jline, I get:

$ ./groovysh
Groovy Shell (1.5.5-SNAPSHOT, JVM: 10.0-b19)
Type 'help' or '\h' for help.
---------------------------------------------
groovy:000> show variables
No variables defined
groovy:000> exit

I am tempted to close this issue off.

As nothing else intentionally changed in the Groovy codebase though I will await someone else to try this.

If anyone wants to try, you can either build from the branch or replace the respective two jars below into a 1.5.4 release (untested but may work):

http://repo1.maven.org/maven2/jline/jline/0.9.94/jline-0.9.94.jar
http://snapshots.repository.codehaus.org/org/codehaus/groovy/groovy-all/1.5.5-SNAPSHOT/groovy-all-1.5.5-20080227.000510-1.jar

Show
Paul King added a comment - - edited Using the latest 1.5.5 snapshot which has an updated jline, I get:
$ ./groovysh
Groovy Shell (1.5.5-SNAPSHOT, JVM: 10.0-b19)
Type 'help' or '\h' for help.
---------------------------------------------
groovy:000> show variables
No variables defined
groovy:000> exit
I am tempted to close this issue off. As nothing else intentionally changed in the Groovy codebase though I will await someone else to try this. If anyone wants to try, you can either build from the branch or replace the respective two jars below into a 1.5.4 release (untested but may work): http://repo1.maven.org/maven2/jline/jline/0.9.94/jline-0.9.94.jar http://snapshots.repository.codehaus.org/org/codehaus/groovy/groovy-all/1.5.5-SNAPSHOT/groovy-all-1.5.5-20080227.000510-1.jar
Hide
Kevin Slater added a comment -

Paul,

I tried your suggestion with my 1.5.4 install on Windows XP. I assumed that I should put the updated jline jar into $GROOVY_HOME/lib and the groovy-all jar into $GROOVY_HOME/embeddable. Doing this still came back with the same behavior as stock 1.5.4. So I guess I'll just have to wait until 1.5.5 to retest.

Show
Kevin Slater added a comment - Paul, I tried your suggestion with my 1.5.4 install on Windows XP. I assumed that I should put the updated jline jar into $GROOVY_HOME/lib and the groovy-all jar into $GROOVY_HOME/embeddable. Doing this still came back with the same behavior as stock 1.5.4. So I guess I'll just have to wait until 1.5.5 to retest.
Hide
Paul King added a comment -

I guess we could increase confidence that 1.5.5 is fixed by trying out 1.6-snapshot. It is also using the updated jline (though it does have other changes):
http://build.canoo.com/groovy/artifacts/20080229203149/dist

Show
Paul King added a comment - I guess we could increase confidence that 1.5.5 is fixed by trying out 1.6-snapshot. It is also using the updated jline (though it does have other changes): http://build.canoo.com/groovy/artifacts/20080229203149/dist
Hide
Paul King added a comment -

I just tried 1.5.5-SNAPSHOT on a second machine that was exhibiting the same issues on 1.5.4. It also seems fixed with 1.5.5-SNAPSHOT. Making as fixed. Please reopen if you can reproduce the problem at a later date.

Show
Paul King added a comment - I just tried 1.5.5-SNAPSHOT on a second machine that was exhibiting the same issues on 1.5.4. It also seems fixed with 1.5.5-SNAPSHOT. Making as fixed. Please reopen if you can reproduce the problem at a later date.
Hide
Weiqi Gao added a comment -

I ran across this bug when I researched a similar issue with another JVM language. See my comment on the JLine issue tracker for

[ 1822900 ] JLine does not work under Cygwin
http://sourceforge.net/tracker/index.php?func=detail&aid=1822900&group_id=64033&atid=506056

The following wrapper will make the stock groovy-1.5.4 groovysh shell function somewhat acceptably under Cygwin + xterm:

#!/bin/bash
#

  1. Run groovysh with the appropriate terminal setting
    #
    stty -icanon min 1 -echo
    groovysh --terminal=unix
    stty icanon echo
Show
Weiqi Gao added a comment - I ran across this bug when I researched a similar issue with another JVM language. See my comment on the JLine issue tracker for [ 1822900 ] JLine does not work under Cygwin http://sourceforge.net/tracker/index.php?func=detail&aid=1822900&group_id=64033&atid=506056 The following wrapper will make the stock groovy-1.5.4 groovysh shell function somewhat acceptably under Cygwin + xterm: #!/bin/bash #
  1. Run groovysh with the appropriate terminal setting # stty -icanon min 1 -echo groovysh --terminal=unix stty icanon echo
Hide
Kevin Slater added a comment -

Thanks very much for that work around! I was able to put it in place and it works pretty much perfectly as far as I've been able to test it. (And I learned something for the next time I run into an issue with jline / cygwin.) Now I can use groovysh again until I get a chance to upgrade to the fixed version of Groovy.

Show
Kevin Slater added a comment - Thanks very much for that work around! I was able to put it in place and it works pretty much perfectly as far as I've been able to test it. (And I learned something for the next time I run into an issue with jline / cygwin.) Now I can use groovysh again until I get a chance to upgrade to the fixed version of Groovy.
Hide
Paul King added a comment -

I added your great suggestion to the troubleshooting section of the groovysh doco on the wiki.

Show
Paul King added a comment - I added your great suggestion to the troubleshooting section of the groovysh doco on the wiki.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: