I'm using groovysh as an alternative to bash. There is one thing I cannot get working. Let suppose I want do some operations and then launch vim. Doing that in bash is as simple as just writing vim file.txt. When I'm running a bash command with groovysh I usually do "command args".execute().text or similar. But it just executes the program and waits for output not giving any input to the command

Is there a way to give the control to an interactive program like vim(or ssh, top, etc) when using groovysh


The docs for execute point to ProcessBuilder.

I tried this in groovysh

pb = new java.lang.ProcessBuilder("vim")
p = pb.start()

But I ended up with an extremely messy blend of groovysh and vim both attempting to be controlled by the same input.

Not sure how to get the vim process to run in the foreground.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.