History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2421
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jason Dillon
Reporter: Bruce Fancher
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

edit command doesn't work on Mac

Created: 19/Dec/07 03:37 PM   Updated: 04/May/08 04:17 AM
Component/s: Groovysh
Affects Version/s: 1.5
Fix Version/s: 1.6-beta-2

Time Tracking:
Not Specified

Environment: MacBook Pro running Leopard, Mac Pro running Leopard


 Description  « Hide
When I try to edit the buffer in an external editor on a Mac, it just goes off into space and never returns:

Groovy Shell (1.5.0, JVM: 1.5.0_13-119)
Type 'help' or '\h' for help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> set verbosity DEBUG
groovy:000> class Foo {
DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Read line: class Foo {
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parsing: class Foo {
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parse incomplete
groovy:001> def bar
DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Read line: def bar
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parsing: class Foo { def bar DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parse incomplete groovy:002> }
DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Read line: }
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parsing: class Foo {
def bar
}
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Parse complete
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Evaluating buffer...
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Compiled script: groovysh_evaluate@eb41e5
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Evaluation result: true (class java.lang.Boolean)
===> true
groovy:000> display
DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Read line: display
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Executing command(display): org.codehaus.groovy.tools.shell.commands.DisplayCommand@b9dc79; w/args: []
Buffer is empty
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Result: null
groovy:000> edit
DEBUG [org.codehaus.groovy.tools.shell.InteractiveShellRunner] Read line: edit
DEBUG [org.codehaus.groovy.tools.shell.Groovysh] Executing command(edit): org.codehaus.groovy.tools.shell.commands.EditCommand@dc3491; w/args: []
DEBUG [org.codehaus.groovy.tools.shell.commands.EditCommand.edit] Executing: vi /tmp/groovysh-buffer9051.groovy
DEBUG [org.codehaus.groovy.tools.shell.commands.EditCommand.edit] Waiting for process: java.lang.UNIXProcess@ff557a



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jason Dillon - 18/Apr/08 03:30 AM
I use TextMate for things which use $EDITOR, so I have:

export EDITOR="mate -w"

And with this, using the edit command does launch a new TextMate window, waits for it to close and then fills the buffer properly from the tmp file it creates...

I do however get the same behavior you see when EDITOR="vi", dunno why...


Jason Dillon - 04/May/08 03:31 AM
One solution is to use TextEdit.app, as in:
export EDITOR=/Applications/TextEdit.app/Contents/MacOS/TextEdit

Jason Dillon - 04/May/08 04:17 AM
Best I can do for this now was to create a new preference 'editor' which defaults to the value of $EDITOR, so you can keep using vi for your normal work, and then configure TextEdit.app for groovysh:
set editor /Applications/TextEdit.app/Contents/MacOS/TextEdit