Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1226

Gremlin Console should :clear automagically after "Display stack trace."

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • 3.1.1-incubating
    • 3.2.2
    • console
    • None

    Description

      I don't know if this is possible, but Martin brought this up the other day. Why not just automatically call :clear after an Exception has been through to get the Console back into an orderly state.

      Attachments

        Activity

          I'd be OK with this I think. Of course, I do tend to do this sometimes:

          gremlin> 1 +
          gremlin> x
          No such property: x for class: groovysh_evaluate
          Display stack trace? [yN] n
          gremlin> 1
          ==>2
          

          If we auto-cleared the buffer, I'd have to re-enter my stuff rather than just recover. Of course, I could just up-arrow the history to get it back i suppose.

          I tend to do this too:

          gremlin> 1 + 
          gremlin> x
          No such property: x for class: groovysh_evaluate
          Display stack trace? [yN] n
          gremlin> :d
           000> 1 + 
          gremlin> 1
          ==>2
          

          :d inspects the buffer so you can see what the heck you have hanging around in there. I guess these are not things that new users would know about though.....

          spmallette Stephen Mallette added a comment - I'd be OK with this I think. Of course, I do tend to do this sometimes: gremlin> 1 + gremlin> x No such property: x for class: groovysh_evaluate Display stack trace? [yN] n gremlin> 1 ==>2 If we auto-cleared the buffer, I'd have to re-enter my stuff rather than just recover. Of course, I could just up-arrow the history to get it back i suppose. I tend to do this too: gremlin> 1 + gremlin> x No such property: x for class: groovysh_evaluate Display stack trace? [yN] n gremlin> :d 000> 1 + gremlin> 1 ==>2 :d inspects the buffer so you can see what the heck you have hanging around in there. I guess these are not things that new users would know about though.....
          rdale Robert Dale added a comment -

          This has gotten me several times early on before I knew about :clear and :d. I think the problem stems from the lack of an indication that there is multi-line input TINKERPOP-1285 . And so :d isn't always immediately obvious.

          Simple example, but think of a complex, multi-line query with a single quote or paren missing:
          gremlin> g.V().has('name,'marko')
          gremlin>
          gremlin>
          gremlin> :d
          000> g.V().has('name,'marko')
          gremlin>

          Again, with multi-line support TINKERPOP-1285 :
          gremlin> g.V().has('name,'marko')
          gremlin:001>

          Ah, it's waiting more input! I must be missing something!

          And maybe this is why 'null' return has been an important indicator to keep around - TINKERPOP-1409 . With multi-line support, it's no longer ambiguous if the console is awaiting more input or has returned.

          rdale Robert Dale added a comment - This has gotten me several times early on before I knew about :clear and :d. I think the problem stems from the lack of an indication that there is multi-line input TINKERPOP-1285 . And so :d isn't always immediately obvious. Simple example, but think of a complex, multi-line query with a single quote or paren missing: gremlin> g.V().has('name,'marko') gremlin> gremlin> gremlin> :d 000> g.V().has('name,'marko') gremlin> Again, with multi-line support TINKERPOP-1285 : gremlin> g.V().has('name,'marko') gremlin:001> Ah, it's waiting more input! I must be missing something! And maybe this is why 'null' return has been an important indicator to keep around - TINKERPOP-1409 . With multi-line support, it's no longer ambiguous if the console is awaiting more input or has returned.

          I like this idea. Though, I don't like the indentation cause by :XXX. Perhaps:

          gremlin> ...
          001    > ...
          002    > .
          gremlin> .
          gremlin> .
          
          okram Marko A. Rodriguez added a comment - I like this idea. Though, I don't like the indentation cause by :XXX . Perhaps: gremlin> ... 001 > ... 002 > . gremlin> . gremlin> .

          Line numbers implemented.

          spmallette Stephen Mallette added a comment - Line numbers implemented.

          People

            spmallette Stephen Mallette
            okram Marko A. Rodriguez
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: