sheehan / grails-console

A web-based Groovy console for interactive runtime application management and debugging
Apache License 2.0
78 stars 41 forks source link

Println output is truncated #41

Open RichB opened 9 years ago

RichB commented 9 years ago

I've tried this in 3 different browsers (Chrome, Firefox, Midori) with the same results. On Ubuntu 14.10, using console version 1.5.5 with Grails 2.3.10. Enter this in the debug console window and press Ctrl-Enter or click the Execute button:

println "This is the time for all good men" println "to come to the aid of their country"

Output window shows:

This is the time for all good men t ≫null [22 ms]

Seems that anything after the first println gets truncated and not always to the same lengths. I originally saw this in 1.5.2 and thought upgrading would fix it. Have been using this plugin for a few years and never saw this before.

sheehan commented 9 years ago

I'm not sure why this would be. I've never seen it. It might have something to do with the system out interceptor. I just pushed a new version that has an out variable bound. Can you try using out.println instead of println and see if that makes a difference?

RichB commented 9 years ago

No difference with 1.5.6 using either println or out.println. Other observations: it seems to output fully whatever I put in the first line, but playing with the length of the lines creates some odd results. I don't quite see a pattern in it. Are you able to reproduce this, or is it just happening to me?

sheehan commented 9 years ago

No, I can't reproduce. Can you check in the developer tools and see if the full output is being returned in the XHR response?

RichB commented 9 years ago

Odd. So it must be something with my system or with our particular Grails project. I'll try it on another box and/or project soon. The form data XHR request (unparsed) is:

autoImportDomains=false&code=println+%22Now+is+the+time%22%0Aprintln+%22For+all+good+men%22

The output response is:

{"totalTime":27,"output":"Now is the time\n\n","result":"null"}

I'm also getting this error in my Grails window. I doubt it is related but including it for completeness:

ERROR resource.ResourceMeta  - Resource not found: /plugins/console-1.5.6/dist/release/backbone.marionette.map