Autofit term not work : Uncaught TypeError: this.refresh is not a function at resizeTerm (term.js:16) resizeTerm @ term.js:16
AlexandreBourrieau opened this issue · comments
Hello,
The automatic rescaling of the terminal is not working for me... If I resize my window, even if I enable the autofit, under the dev tools in chrome I got the error below when I resize the window.
Uncaught TypeError: this.refresh is not a function at resizeTerm (term.js:16) resizeTerm @ term.js:16
I think that the rescaling funciton is not called because of this error, which explain why autofit do not work...
Any idea to resolve this ? Or can I call the refresh funcion using a external script ??
Thanks in advance !
Edit :
It seems that the term.onResize((size) {}
in wetty.js is not cautch when resizing the window...
Ok I change a little bit the code :
In wetty.js I add this after window.addEventListener('beforeunload', verifyPrompt, false);
window.addEventListener('resize', function() {term.resizeTerm();});
And now it works.
I still get this error with the current docker image (amd64):
Uncaught TypeError: this.refresh is not a function
at resizeTerm (term.js:16:10)
resizeTerm @ term.js:16
This code seems to be the problem:
export class Term extends Terminal {
// ...
resizeTerm() {
this.refresh(0, this.rows - 1);
if (shouldFitTerm())
this.fitAddon.fit();
this.socket.emit("resize", {cols: this.cols, rows: this.rows});
}
}
Yep looks like the scope of the function is wrong should be resolved in the 2.4.3