Grails
  1. Grails
  2. GRAILS-8542

Interactive mode should have persistent command line history

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 final
    • Fix Version/s: 2.1-RC1
    • Component/s: None
    • Labels:
      None

      Description

      The cli history should be persisted between interactive console sessions.

      The history could be stored in the home folder of the user under a file called '.grails_history', similar to the '.bash_history' that the bash shell uses.

        Issue Links

          Activity

          Hide
          Konstantinos Kostarellis added a comment -

          Please persist the history per project not globally.
          IMO that would produce a better user experience.

          Show
          Konstantinos Kostarellis added a comment - Please persist the history per project not globally. IMO that would produce a better user experience.
          Hide
          Marco Vermeulen added a comment -

          Hi Konstantinos,

          I've started off with the simple implementation first. If I see others asking for history per project, I will most certainly look at implementing this.

          Anybody else have this requirement? How would it enhance the user experience?

          Show
          Marco Vermeulen added a comment - Hi Konstantinos, I've started off with the simple implementation first. If I see others asking for history per project, I will most certainly look at implementing this. Anybody else have this requirement? How would it enhance the user experience?
          Hide
          Konstantinos Kostarellis added a comment -
          How would it enhance the user experience?

          Just think of stuff like commands you want to call more then once like

          • test-app :unit foo.bar.*

          Where the package foo.bar is unique to a project and doesn't make sense to another one. If you switch from project to project it just messes up your history and the commands you would want to use specific to a project.

          Or for a different more simple example u might be using something like

          • create-app foo.bar.Baz

          and then later on at some point you might want to continue with something like

          • create-app foo.bar.Qux

          you could recall the last commands and just change the ending. (As package names are often similar in a project, but not for different projects) etc. etc.

          Don't get me wrong I'm happy with the simple implementation already, just thought of making it even more user friendly.

          By the way is it possible to implement something like bash's reverse search Ctrl+R in JLine ?

          Show
          Konstantinos Kostarellis added a comment - How would it enhance the user experience? Just think of stuff like commands you want to call more then once like test-app :unit foo.bar.* Where the package foo.bar is unique to a project and doesn't make sense to another one. If you switch from project to project it just messes up your history and the commands you would want to use specific to a project. Or for a different more simple example u might be using something like create-app foo.bar.Baz and then later on at some point you might want to continue with something like create-app foo.bar.Qux you could recall the last commands and just change the ending. (As package names are often similar in a project, but not for different projects) etc. etc. Don't get me wrong I'm happy with the simple implementation already, just thought of making it even more user friendly. By the way is it possible to implement something like bash's reverse search Ctrl+R in JLine ?
          Hide
          Marco Vermeulen added a comment -

          Pull request issued for this:
          https://github.com/grails/grails-core/pull/145

          Show
          Marco Vermeulen added a comment - Pull request issued for this: https://github.com/grails/grails-core/pull/145
          Hide
          Burt Beckwith added a comment -

          Thanks for the pull request.

          Show
          Burt Beckwith added a comment - Thanks for the pull request.
          Hide
          Nicholas Wittstruck added a comment -

          Is this broken in 2.2.2? I had to "touch ~/.grails_history" to get it working, so it seems the file is not created properly.

          Show
          Nicholas Wittstruck added a comment - Is this broken in 2.2.2? I had to "touch ~/.grails_history" to get it working, so it seems the file is not created properly.
          Hide
          René Scheibe added a comment -
          Show
          René Scheibe added a comment - Created http://jira.grails.org/browse/GRAILS-10266 .

            People

            • Assignee:
              Burt Beckwith
              Reporter:
              Marco Vermeulen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development