Groovy shell interrupt handling

In the groovy shell, if you type this:

$ groovysh
Groovy Shell (2.3.7, JVM: 1.7.0_11)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
groovy:000> (1..1234567)

and accidentally press Enter, you are likely to spoil your current session, not hoping that you can continue. This was a simple example: let's say you do something like:

(1..123456).collect { 'abc' * 80 }

You get the gist - and obviously, you can do something in the console where you have the state you want to work with. Any way to tell groovy to stop but not kill groovysh (which Ctrl+Cdoes)?

Or, conversely, tell him to print less each time if more is no longer requested? You do not know what is possible if something is some kind of hint?

+4
source share
1 answer

Groovysh, , ctrl-c . :

while(true)Thread.sleep(1000);

:

while(true);

groovyconsole , Groovysh, , , .

JLine, groovy , jline :

groovysh -console=false

ctrl-c ctrl-c. , ctrl-c, - ?

GroovyConsole "" ctrl-c, , . Groovysh, -, SIGINT ( , ) JLine Windows ...

, , , GroovyConsole, Groovysh.

+1

All Articles