Rails Console

The console output window seems to buffer the output so that if I assign a large number of records from an ActiveRecord source I have to hit enter until it's coughed up the entire array a line at a time before I can enter in the next command.  Is there a way to clear the output window or a setting that keeps it from echoing the result of the statement?

3 comments
Comment actions Permalink

In latest 4.5 EAP build there is a button to clear console.  Though I have to say I'm not sure I've got clear picture of your problem :(  thus I can not suggest better solution (if it exist)

Oleg.

0
Comment actions Permalink

I just ran a check for updates and this is the result:
UpdateInfo.pngAbout.png
I'll try to show you with a five screen views:

Here is a screen showing how many records there are in the Store model:
Screen1.png
Next is the assignment of the records to variable s:
Screen2.png
After pressing enter with the above command it shows the following:
Screen3.png
You'll notice that it just shows the first line of record data and appears to be ready for the next command.
Next I will type a simple command to show you that after I hit 'enter' it shows the next line of the record data rather than the rusults of the new command.
Screen4.png
Above is the command before hitting enter and here is the screen after:
Screen5.png
As you can see it's not the results of the last command, but another line of record data from the previous command.  In fact I have to now repeatedly hit 'enter' if I want to get to where my screen has finally dumped all the record data so that I can see the result of my puts 'test' command.  I have also noticed that if I wait about 15 minutes rather than hitting 'enter' a few hundred times, Rubymine will eventually get there while sucking up about 25% of my CPU during that time.  I have found that I can avoid the display of the record data if I simply do the following:
s=Store.all;0
But I'm wondering if there's a setting somewhere to suppress the echoing feature.  Is the button you referred to showing on my screens?  I've tried unsuccessfully to use the context menu 'Clear all' and I'm not sure why there is a 'Stop Process' button, since there seems to be no way to restart after hitting it.  Why not just do away with the 'Stop Process' if you have to hit the 'Close' button and restart a new console to get it going again.

0
Comment actions Permalink

Hi Frank,

I've played with the console a little bit and I was able to reproduce the problem.
The problem is that (for some reasons) some commands are slowly processed.
If you will be patient enough the command will be executed and your next hit will just execut a new command.
I've filed http://youtrack.jetbrains.com/issue/RUBY-11323 about the slowness
As for "clear" button: it is available in latest 4.5.eap builds, not in 4.0.3 and I doubt it will help you since the cause of the proble is in slow output.

Oleg.

0

Please sign in to leave a comment.