Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GroovyShell exit multiline

GroovyShell doesn't seem to exit multiline when invalid input is entered. Example:

groovy:000> InvalidClosure {
groovy:001> meaninglessCommands
groovy:002> }
ERROR groovy.lang.MissingMethodException:
No signature of method: groovysh_evaluate.InvalidClosure() is applicable 
for argument types: (groovysh_evaluate$_run_closure1) values: 
[groovysh_evaluate$_run_closure1@5a9f4771]
groovy:002>

I can't get back to groovy:000> no matter what I try, and the REPL keeps interpreting the invalid commands, since it understands I'm still on the same multiline command.

How do I exit from this multiline instance?

like image 637
Rafael Avatar asked Jun 12 '26 09:06

Rafael


1 Answers

Just type :clear.

groovy:000> ?
[...]
Available commands:
  :help      (:h ) Display this help message
  ?          (:? ) Alias to: :help
[...]
  :display   (:d ) Display the current buffer
  :clear     (:c ) Clear the buffer and reset the prompt counter
[...]
like image 69
Hugues M. Avatar answered Jun 16 '26 14:06

Hugues M.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!