Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const { Terminal } = require('xterm');
Terminal.prototype.resize = function (x, y) {
if (isNaN(x) || isNaN(y)) {
return;
}
if (x === this.cols && y === this.rows) {
// PATCH BEGIN https://github.com/xtermjs/xterm.js/issues/1278
if (this.charMeasure) {
if (!this.charMeasure.width || !this.charMeasure.height) {
this.charMeasure.measure(this.options);
}
}
// PATCH END
return;
}
if (x < 1)
x = 1;
if (y < 1)