-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
naively limit history size #14
Conversation
TODO: - setting for history size? - force the creation of new items after a certain length. No clue how to do this, but it is necessary to keep the console from displaying to many lines and crash Atom (ref JunoLab/atom-julia-client#40)
@@ -53,6 +55,10 @@ class ConsoleView extends ScrollView | |||
else | |||
@addBeforeInput item, opts | |||
|
|||
limitHistory: (maxSize = 1000) -> | |||
if @items.childNodes.length > maxSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this a while
instead of if
, so that if something happens that causes multiple messages to get inserted for a single call to limitHistory
it will still work to keep the list limited. I don't think that can happen now, but it's the sort of thing that could easily happen due to error or future refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will do.
Alright. So I just tried breaking out of the On a side note: I don't understand why the buffering should be implemented in this way. Wouldn't it be more natural and closer to every REPL ever to buffer until a So, unless there's something seriously wrong with that idea, I'll have a go at implementing that tomorrow. Also, cc @one-more-minute since the buffering was your idea and you probably had something in mind when creating the current implementation ;) |
👍 to newline splitting. That would also fix places where long output can get split in unexpected ways. one issue is that if there's a longish-running process that's outputting without printing a newline (like dots printed during test runs or something) then we wouldn't see any output. Not sure what the best solution to that is, except maybe splitting the output on every newline but also setting a timeout that adds to the current cell instead of starting a new one? TTYs are hard. |
So I got this basically working today. The output would pretty much look like in the REPL with every new line in a seperate So if someone has any ideas on how to get fast splitting on new lines (and only there, ideally) here, feel free! :) |
TODO: