Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9949

Ability to pass handleUserInterrupt=true to groovsh creation process

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.7
    • None
    • Groovysh
    • None

    Description

      I am building webtau REPL based on groovysh.

      Right now I am looking for ways to handle ctrl+c to stop currently running command instead of closing the whole REPL process.

      After some googling I found that Jline has `handleUserInterrupt` property. I am not sure if that will fully solve my problem.
      I can't find a way to pass the prop during groovsh instance creation. 

       

      groovysh.runner.reader.handleUserInterrupt = true

       

      Is throwing null pointer as the `runner` instance gets created only after `run`. And `run` takes control and you can't set anything after it. 

      Would it be possible to add an option to pass handleUserInterrupt? 

      If you are aware of other ways to handle ctrl+c - that would be super helpful 

      Thank you. 

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ninside Mykola Golubyev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: