-
Notifications
You must be signed in to change notification settings - Fork 88
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
Work with (and require) newer notebook version #46
Conversation
- Update for newer version & location of xterm - Bump minimum required notebook version
Someone should test this - about 1/3 of the time this crashes my browser, which is a pretty adverse side effect! |
This seemed to work fine on summer-test with materials-sp2018 a few times, but it failed on: After displaying the initial horizontal scrollbar and showing no movement for 5-10s, my browser showed this: |
I tested this pull request by using it to pull the same repository as @ryanlovett above. In Firefox 61, it doesn't crash the browser, but it does eat up all of the CPU cycles and RAM it can get, eventually hitting some It may be relevant that there is no public repository at https://github.com/data-8/materials-sp17 (I get a 404). I think the likely culprit is xtermjs/xterm.js#1416. Calling |
Because the parent of the terminal element must be visible when diff --git a/nbgitpuller/static/index.js b/nbgitpuller/static/index.js
index 8057407..19ac9a4 100644
--- a/nbgitpuller/static/index.js
+++ b/nbgitpuller/static/index.js
@@ -66,7 +66,6 @@ require([
convertEol: true
});
this.visible = false;
- this.term.open($(termSelector)[0]);
this.$progress = $(progressSelector);
this.$termToggle = $(termToggleSelector);
@@ -85,7 +84,10 @@ require([
$(this.termSelector).parent().addClass('hidden');
}
this.visible = visible;
- this.term.fit();
+ if (visible) {
+ this.term.open($(this.termSelector)[0]);
+ this.term.fit();
+ }
} I'm not sure if this causes any of its own resource leaks (if one toggles the terminal repeatedly, say), but it's better than an immediate infinite resource allocation. Also, it feels like xterm.js may just be more trouble than it's worth for this use. Would inserting received output into a suitably-styled |
And don't call fit when terminal isn't open yet. This causes your browser to crash!
@liffiton thank you so very much for tracking this down! Was driving me nuts :) I've implemented a slight variation of your suggested change, and it works great! <3 |
Sure thing! It was bugging me too. |
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.
Everything works great now.
Fixes #45