Issue #821 - Prevent TypeError in resize()

This commit is contained in:
Jon Masters 2017-07-27 17:21:31 +01:00 committed by Paris Kasidiaris
parent f36bd24e1e
commit 2d4e617c95
4 changed files with 1149 additions and 955 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@ npm-debug.log
.env .env
build/ build/
.vscode/ .vscode/
.DS_Store
# Directories needed for code coverage # Directories needed for code coverage
/coverage/ /coverage/

2098
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@
"@types/jsdom": "^11.0.1", "@types/jsdom": "^11.0.1",
"@types/mocha": "^2.2.33", "@types/mocha": "^2.2.33",
"@types/node": "^6.0.41", "@types/node": "^6.0.41",
"browserify": "^13.1.0", "browserify": "^13.3.0",
"chai": "3.5.0", "chai": "3.5.0",
"docdash": "0.4.0", "docdash": "0.4.0",
"express": "4.13.4", "express": "4.13.4",

View File

@ -1941,6 +1941,9 @@ Terminal.prototype.resize = function(x, y) {
ch = [this.defAttr, ' ', 1]; // does xterm use the default attr? ch = [this.defAttr, ' ', 1]; // does xterm use the default attr?
i = this.buffer.lines.length; i = this.buffer.lines.length;
while (i--) { while (i--) {
if (this.buffer.lines.get(i) === undefined) {
this.buffer.lines.set(i, this.blankLine());
}
while (this.buffer.lines.get(i).length < x) { while (this.buffer.lines.get(i).length < x) {
this.buffer.lines.get(i).push(ch); this.buffer.lines.get(i).push(ch);
} }