Grails

Cygwin: Grails 2.0.0 - Scripts not accepting user input

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.0-RC1
  • Fix Version/s: 2.2
  • Component/s: Build System
  • Labels:
  • Environment:
    Windows 7 SP1 on Intel Core i5
    Cygwin
    Grails 2.0.0.RC1
    Groovy 1.9.0-beta-4
    Java 1.7.0_01

Description

I have been trying to use latest Grails on Windows 7 SP1, Core i5, Cygwin - but the grails scripts are not accepting user input... it just hangs there waiting, even though I type 'y' to the question. When you CTRL-C, bash thinks the 'y' has been typed as the next command. (Everything was OK on 1.3.7 and 1.4.0.M1)

[03/11/2011 @ 21:58 - just tried 2.0.0.RC1 in Command Window and all OK, so this is an issue interacting in Cygwin/Bash. I also just dropped grails back to 1.4.0.M1 and Cygwin/Bash works OK. This issue is important to me as I am in a locked down environment and am blocked from using Command Window]

$ which grails 
/cygdrive/c/devenv/grails/grails-2.0.0.RC1/bin/grails 

Gordon@GordonLaptop /cygdrive/c/Users/Gordon/Documents/src/grails/recoup 
$ which groovy 
/cygdrive/c/devenv/groovy/groovy-1.9.0-beta-4/bin/groovy 

Gordon@GordonLaptop /cygdrive/c/Users/Gordon/Documents/src/grails/recoup 
$ java -version 
java version "1.7.0_01" 
Java(TM) SE Runtime Environment (build 1.7.0_01-b08) 
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing) 

Gordon@GordonLaptop /cygdrive/c/Users/Gordon/Documents/src/grails/recoup 
$ grails create-domain-class Depot 

| Loading Grails 2.0.0.RC1 
| Configuring classpath 
| Configuring classpath. 
| Environment set to development 
| Environment set to development. 
| Environment set to development.. 
| Environment set to development... 
| Environment set to development.... 
| Environment set to development..... 
 You currently already have a version of the plugin installed 
 [resources-1.0.2]. Do you want to update to [resources-1.1.1]? [y,n] y

Any pointers / suggestions cos I am pulling my hair out...

Activity

Hide
Sam Carr added a comment -

I am also seeing this problem on Cygwin on Win7. Specifically, using the "Cygwin Terminal" provided by a brand new install of Cygwin (rather than older Cygwin terminal emulator approaches - though I haven't tried them), I can type grails to go into interactive mode, but then anything I type is ignored and when I give up and ctrl-C to escape grails, it then runs the text I typed as the command prompt. So something's not hooked up right. This is indeed a bit of a problem for Windows developers, though I can workaround it by using a normal Windows cmd prompt.

Show
Sam Carr added a comment - I am also seeing this problem on Cygwin on Win7. Specifically, using the "Cygwin Terminal" provided by a brand new install of Cygwin (rather than older Cygwin terminal emulator approaches - though I haven't tried them), I can type grails to go into interactive mode, but then anything I type is ignored and when I give up and ctrl-C to escape grails, it then runs the text I typed as the command prompt. So something's not hooked up right. This is indeed a bit of a problem for Windows developers, though I can workaround it by using a normal Windows cmd prompt.
Hide
Jeff Brown added a comment -

Does this problem occur with the 2.0 release? (the original issue was filed against 2.0-RC1)

Show
Jeff Brown added a comment - Does this problem occur with the 2.0 release? (the original issue was filed against 2.0-RC1)
Hide
Gordon Rehling added a comment -

Yes, this is still a problem as of release 2.0.0

In fact it's a show stopper for me in a locked down, corporate environment, within a major UK retailer.
Cmd Window is disabled, so I need to use cygwin to drive the command line.
The MSDOS prompt is available and allows me to run the scripts and enter input, but it's unusably clunky for day to day use.

I have dropped back to 1.3.7 for moment.

Does anyone know if STS uses Cmd Window as a background process to the IDE when running commnad lines, or is there something more sophisticated going on under the hood... was wondering if that might be another workaround for me?

Show
Gordon Rehling added a comment - Yes, this is still a problem as of release 2.0.0 In fact it's a show stopper for me in a locked down, corporate environment, within a major UK retailer. Cmd Window is disabled, so I need to use cygwin to drive the command line. The MSDOS prompt is available and allows me to run the scripts and enter input, but it's unusably clunky for day to day use. I have dropped back to 1.3.7 for moment. Does anyone know if STS uses Cmd Window as a background process to the IDE when running commnad lines, or is there something more sophisticated going on under the hood... was wondering if that might be another workaround for me?
Hide
Graeme Rocher added a comment -

Could be related to http://softwaremavens.blogspot.com/2009/10/cgwin-interpretersjline-carriage-return.html

Could someone try run the grails command inside cygwin with:

grails -Djline.terminal=jline.UnixTerminal
Show
Graeme Rocher added a comment - Could be related to http://softwaremavens.blogspot.com/2009/10/cgwin-interpretersjline-carriage-return.html Could someone try run the grails command inside cygwin with:
grails -Djline.terminal=jline.UnixTerminal
Hide
Gordon Rehling added a comment -

Below is output on WinXP SP3.

Interestingly, I have managed to install STS 2.9.0.M2 here, download grails support and grails 2.0.0 inside STS and I can create a simple domain and run it - however, I get the same RegCreateKeyEx error on stderr.

bash-3.2$ which grails
/cygdrive/g/GENERAL/devenv/grails/grails-2.0.0/bin/grails
bash-3.2$ ls
application.properties grails-app lib scripts src target test web-app
bash-3.2$ grails -Djline.terminal=jline.UnixTerminal
cygpath: unknown option – j

Loading Grails 2.0.0
Configuring classpath
07-Feb-2012 13:10:09 java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion:
grails> upgrade
[did CTRL-C here cos it was hanging]
bash-3.2$ upgrade
bash: upgrade: command not found
[input 'upgrade' wasn't read by grails, instead bash handled it]
bash-3.2$
Show
Gordon Rehling added a comment - Below is output on WinXP SP3. Interestingly, I have managed to install STS 2.9.0.M2 here, download grails support and grails 2.0.0 inside STS and I can create a simple domain and run it - however, I get the same RegCreateKeyEx error on stderr. bash-3.2$ which grails /cygdrive/g/GENERAL/devenv/grails/grails-2.0.0/bin/grails bash-3.2$ ls application.properties grails-app lib scripts src target test web-app bash-3.2$ grails -Djline.terminal=jline.UnixTerminal cygpath: unknown option – j
Loading Grails 2.0.0
Configuring classpath 07-Feb-2012 13:10:09 java.util.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion: grails> upgrade [did CTRL-C here cos it was hanging] bash-3.2$ upgrade bash: upgrade: command not found [input 'upgrade' wasn't read by grails, instead bash handled it] bash-3.2$
Hide
Graeme Rocher added a comment -

I installed Cygwin myself and if I use the jline.UnixTerminal parameter then user input works fine:

Graeme Rocher@WIN-MUKKPM3Q2BP ~
$ /cygdrive/c/java/grails-core/bin/grails.bat -Djline.terminal=jline.UnixTerminal

| Loading Grails 2.0.1.BUILD-SNAPSHOT
| Configuring classpath
| Enter a script name to run. Use TAB for completion:
grails> list-plugins
list-plugins
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
You do not have any plugins installed.

To find more info about plugin type 'grails plugin-info [NAME]'

To install type 'grails install-plugin [NAME] [VERSION]'

For further info visit http://grails.org/Plugins

grails>
Show
Graeme Rocher added a comment - I installed Cygwin myself and if I use the jline.UnixTerminal parameter then user input works fine:
Graeme Rocher@WIN-MUKKPM3Q2BP ~
$ /cygdrive/c/java/grails-core/bin/grails.bat -Djline.terminal=jline.UnixTerminal

| Loading Grails 2.0.1.BUILD-SNAPSHOT
| Configuring classpath
| Enter a script name to run. Use TAB for completion:
grails> list-plugins
list-plugins
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
You do not have any plugins installed.

To find more info about plugin type 'grails plugin-info [NAME]'

To install type 'grails install-plugin [NAME] [VERSION]'

For further info visit http://grails.org/Plugins

grails>
Hide
Graeme Rocher added a comment -

lowering priority since there is a workaround

Show
Graeme Rocher added a comment - lowering priority since there is a workaround
Hide
Gordon Rehling added a comment -

I've just had an AHA! moment regarding Grails on Cygwin on Windows - which I will share and hope it helps others...

I've been typing [b]grails[/b] because I thought that Cygwin would do the right thing and run the *nix commands on top of windows. I tried the command line options suggested but they don't make things work.
<code>
bash-3.2$ grails -Djline.terminal=jline.UnixTerminal
cygpath: unknown option – j

Loading Grails 2.0.0
Configuring classpath
09-Feb-2012 10:55:34 java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion:
grails> list-plugins

bash-3.2$ list-plugins
bash: list-plugins: command not found
</code>

I spotted that Graeme just typed [b]grails.bat[/b] and this behaves differently...
<code>
bash-3.2$ grails.bat

Loading Grails 2.0.0
Configuring classpath
09-Feb-2012 11:01:51 java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion:
grails> list-plugins

bash-3.2$ list-plugins
bash: list-plugins: command not found
</code>

However, it still doesn't work until you add the command line options...
<code>
bash-3.2$ grails.bat -Djline.terminal=jline.UnixTerminal

Loading Grails 2.0.0
Configuring classpath
09-Feb-2012 11:02:34 java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion:
grails> list-plugins
list-plugins
Environment set to development
Environment set to development.
Environment set to development..
Environment set to development...
Environment set to development....
Environment set to development.....
You do not have any plugins installed.

To find more info about plugin type 'grails plugin-info [NAME]'

To install type 'grails install-plugin [NAME] [VERSION]'

For further info visit http://grails.org/Plugins

grails>
</code>

I presume the intention is still to fix [b]grails[/b] and not force use of [b]grails.bat[/b] ?

In the meantime I have managed to get STS 2.9.0.M2 up and running on both my personal Win7 laptop and corporate WinXP PC... so think I will try that route for a while...

Gordon

Show
Gordon Rehling added a comment - I've just had an AHA! moment regarding Grails on Cygwin on Windows - which I will share and hope it helps others... I've been typing [b]grails[/b] because I thought that Cygwin would do the right thing and run the *nix commands on top of windows. I tried the command line options suggested but they don't make things work. <code> bash-3.2$ grails -Djline.terminal=jline.UnixTerminal cygpath: unknown option – j
Loading Grails 2.0.0
Configuring classpath 09-Feb-2012 10:55:34 java.util.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion: grails> list-plugins
bash-3.2$ list-plugins bash: list-plugins: command not found </code> I spotted that Graeme just typed [b]grails.bat[/b] and this behaves differently... <code> bash-3.2$ grails.bat
Loading Grails 2.0.0
Configuring classpath 09-Feb-2012 11:01:51 java.util.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion: grails> list-plugins
bash-3.2$ list-plugins bash: list-plugins: command not found </code> However, it still doesn't work until you add the command line options... <code> bash-3.2$ grails.bat -Djline.terminal=jline.UnixTerminal
Loading Grails 2.0.0
Configuring classpath 09-Feb-2012 11:02:34 java.util.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Enter a script name to run. Use TAB for completion: grails> list-plugins list-plugins
Environment set to development
Environment set to development.
Environment set to development..
Environment set to development...
Environment set to development....
Environment set to development..... You do not have any plugins installed.
To find more info about plugin type 'grails plugin-info [NAME]' To install type 'grails install-plugin [NAME] [VERSION]' For further info visit http://grails.org/Plugins grails> </code> I presume the intention is still to fix [b]grails[/b] and not force use of [b]grails.bat[/b] ? In the meantime I have managed to get STS 2.9.0.M2 up and running on both my personal Win7 laptop and corporate WinXP PC... so think I will try that route for a while... Gordon

People

Vote (4)
Watch (2)

Dates

  • Created:
    Updated:
    Last Reviewed: